Re: Form.findSubmittingButton throws exceptions
https://issues.apache.org/jira/browse/WICKET-5672 Improved in Wicket 7.x only. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Aug 7, 2014 at 3:34 PM, Martin Grigorov mgrigo...@apache.org wrote: I think that it should return the found submitter. If the caller cares whether the submitter is visible/enabled then it can do its own check for this. I'll raise the question in the dev@ mailing list. If no one objects then I'll modify it. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Aug 7, 2014 at 3:24 PM, Jack Berg erki.pub...@gmail.com wrote: Wouldn't it return null, if the form was not submitted by a IFormSubmittingComponent? I have attached a quickstart to show my current situation. The exception is always thrown after submitting. testfindsubmit.zip http://apache-wicket.1842946.n4.nabble.com/file/n4666926/testfindsubmit.zip -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-findSubmittingButton-throws-exceptions-tp4666910p4666926.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: Form.findSubmittingButton throws exceptions
Thank you! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-findSubmittingButton-throws-exceptions-tp4666910p4667030.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: Form.findSubmittingButton throws exceptions
Wouldn't it return null, if the form was not submitted by a IFormSubmittingComponent? I have attached a quickstart to show my current situation. The exception is always thrown after submitting. testfindsubmit.zip http://apache-wicket.1842946.n4.nabble.com/file/n4666926/testfindsubmit.zip -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-findSubmittingButton-throws-exceptions-tp4666910p4666926.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: Form.findSubmittingButton throws exceptions
I think that it should return the found submitter. If the caller cares whether the submitter is visible/enabled then it can do its own check for this. I'll raise the question in the dev@ mailing list. If no one objects then I'll modify it. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Aug 7, 2014 at 3:24 PM, Jack Berg erki.pub...@gmail.com wrote: Wouldn't it return null, if the form was not submitted by a IFormSubmittingComponent? I have attached a quickstart to show my current situation. The exception is always thrown after submitting. testfindsubmit.zip http://apache-wicket.1842946.n4.nabble.com/file/n4666926/testfindsubmit.zip -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-findSubmittingButton-throws-exceptions-tp4666910p4666926.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
Form.findSubmittingButton throws exceptions
Hi! Form.findSubmittingButton is documented as Gets the IFormSubmittingComponent which submitted this form. Returns: The component which submitted this form, or null if the processing was not triggered by a registered IFormSubmittingComponent But if the button is not visible or enabled, an exception is thrown. I did not expect that. Why is it implemented like that? I have a textfield which required attribute depends on the button that is pressed. So I have overridden isRequired and call findSubmittingButton form the new method. The page also has an onConfigure method where I hide that same Button if it has been pressed. So I always get a Submit Button btn (path=f:btn) is not visible exception. I have resorted to calling my own findSubmittingButton utility method. But I wonder why is such a check necessary. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-findSubmittingButton-throws-exceptions-tp4666910.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: Form.findSubmittingButton throws exceptions
Hi, I am not sure but I guess it is like this to prevent calling onSubmit() on it. Form processing uses findSubmittingButton() to find the button and call its #onSubmit() before calling form.onSubmit(). Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed, Aug 6, 2014 at 4:13 PM, Jack Berg erki.pub...@gmail.com wrote: Hi! Form.findSubmittingButton is documented as Gets the IFormSubmittingComponent which submitted this form. Returns: The component which submitted this form, or null if the processing was not triggered by a registered IFormSubmittingComponent But if the button is not visible or enabled, an exception is thrown. I did not expect that. Why is it implemented like that? I have a textfield which required attribute depends on the button that is pressed. So I have overridden isRequired and call findSubmittingButton form the new method. The page also has an onConfigure method where I hide that same Button if it has been pressed. So I always get a Submit Button btn (path=f:btn) is not visible exception. I have resorted to calling my own findSubmittingButton utility method. But I wonder why is such a check necessary. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Form-findSubmittingButton-throws-exceptions-tp4666910.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