AjaxFormComponentUpdatingBehavior( change ) on a DropDownChoice
Dear Forum, I have a drop down choice for populating form fields with default values. To achieve this, I have added an AjaxFormComponentUpdatingBehavior( change ) to the drop down choice. Inside the AjaxFormComponentUpdatingBehavior.onUpdate() I populate all fields of the form and call target.add() for refreshing the form fields. Also, inside the form, I have an ajax button (not the main form submit button), which I have set to ajaxbutton.setDefaultFormProcessing( false ); The ajaxbutton.onSubmit(AjaxRequestTarget target, Form? form) is empty. Just a simple println() statement for testing purposes. The problem I have now is that if I click the ajaxbutton, the drop down choice ajax no longer updates the form fields. However, if I set ajaxbutton.setDefaultFormProcessing( true ); then the drop down choice ajax works as expected. Has anyone encountered a similar problem? I'm clueless and It's doing my head in. The problem is that I tried to reproduce it on a stand-alone page and I cannot even reproduce the bug. Thanks in advance, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-change-on-a-DropDownChoice-tp4660065.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxFormComponentUpdatingBehavior( change ) on a DropDownChoice
Hi, I'm not sure what is the reason for this problem but you can use AjaxLink instead if you don't need to submit the form and to processing it. On Fri, Jul 5, 2013 at 9:51 AM, lucast lucastol...@hotmail.com wrote: Dear Forum, I have a drop down choice for populating form fields with default values. To achieve this, I have added an AjaxFormComponentUpdatingBehavior( change ) to the drop down choice. Inside the AjaxFormComponentUpdatingBehavior.onUpdate() I populate all fields of the form and call target.add() for refreshing the form fields. Also, inside the form, I have an ajax button (not the main form submit button), which I have set to ajaxbutton.setDefaultFormProcessing( false ); The ajaxbutton.onSubmit(AjaxRequestTarget target, Form? form) is empty. Just a simple println() statement for testing purposes. The problem I have now is that if I click the ajaxbutton, the drop down choice ajax no longer updates the form fields. However, if I set ajaxbutton.setDefaultFormProcessing( true ); then the drop down choice ajax works as expected. Has anyone encountered a similar problem? I'm clueless and It's doing my head in. The problem is that I tried to reproduce it on a stand-alone page and I cannot even reproduce the bug. Thanks in advance, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-change-on-a-DropDownChoice-tp4660065.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxFormComponentUpdatingBehavior( change ) on a DropDownChoice
Thank you, Martin. That seems to have done the trick. I would really like to found out why ajax functionality broke. The irritating bit is the fact I cannot even reproduce the bug on a stand-alone form. Everything else inside the AjaxFormComponentUpdatingBehavior.onUpdate() works. just target.add(formFields) is not updating the fields. If any other reader out there has encountered this problem, please let me know. Thanks, once more. Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-change-on-a-DropDownChoice-tp4660065p4660069.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org