I'm working on a plugin based on the select-or-add 'slice' from web2py slices 
and I've run into a basic problem: Is there any way to refresh the options in a 
select box from the db without a) submitting the form or b) losing the user 
input from other form fields?

In a SQLFORM, the select-or-add slice lets you add a row to a linked table via 
an Ajax modal dialog and then have that item appear in the select box without 
refreshing the form. But the new option is just added to the select widget via 
jQuery. What I'd like to be able to do is run a controller via ajax that would 
actually repopulate the select options from db--as if that one form widget were 
an Ajax component within the form.

This would solve a couple of problems in a project I'm working on which 
involves a fairly complex data-entry form. E.g., When the user selects an 
option from widget A, this triggers a controller that filters the options in 
widget B via Ajax. Is there a web2py mechanism for this?

Thanks

Reply via email to