so maybe we leave the pre-validation submit as formSubmitted() and change onValidSubmit() to onSubmit() ?
anyway, i'd like to get some other opinions here as well... what do other people think?
onError() is called when one or more validators fail (you can choose how many errors to show in your feedback panel).
also, 99% of the time you wouldn't want to override onError() as validators pretty much take care of themselves.
another thing to be aware of is that in multiple-button submits, your /button's/ onSubmit will be called. you decide what to do there, possibly calling validate() if it's an okay type button or doing something else. when you call validate, if the form validates, that's when onValidSubmit() gets called.
please take a look at the form input example to see what i mean by some of these things... in particular you'll see that you simply don't deal with onError().
Martijn Dashorst wrote:
When I am developing an application, I'm normally only interested in valid submits or error submits. Not the 'advanced submit' which occurs before validation.
I find the name 'xxxValidSubmit' kind of not what I'm looking for. Having onError and onSubmit should suffice. The pre-validation submit shuold fall in the advanced section, and be targeted as such.
Having an onError which will be called when (one of) the validators fail, should push most users into using the validators and onError, instead of parsing the submitted values directly in the onPreValidationSubmit().
Martijn
Martijn
Jonathan Locke wrote:
so, maybe:
onSubmit() - IFormSubmitListener method onValidSubmit() - Form method called when valid form is submitted onError() - Form method called when validation errors occur
?
of course this makes me want to rename the event handlers in ILinkListener, IOnChangeListener, IRedirectListener and IResourceListener...
i'm good with the onX() pattern for events. should we make this more consistent like this?
Jonathan Locke wrote:
we could call it onValidSubmit() if you like, but onSubmit() is asking for trouble because it's not formSubmitted(), which is the onSubmit() handler (handles form submits, but not validated form submits). if you want to handle all form submissions, it's formSubmitted(). we could change that one to onSubmit() except that none of the other IResourceRequestListener subclasses use this pattern...
Eelco Hillenius wrote:
I don't know... I like onSubmit etc (short and to the point, consistent with e.g. onLinkClicked). On the other hand, onLinkClicked will be called directly/ is the same as the interface method, but from handleXXX it is clear (at least to me) that Wicket did some processing after the interface method was called.
Eelco
Martijn Dashorst wrote:
If anything, the rename should have been to: - onSubmit() and create a new one if you want to differentiate an error condition: - onError()
This is more consistent with the rest of Wicket: event handlers begin always with 'on'.
Martijn
Martijn Dashorst wrote:
Hi,
I was checkout out HEAD and encountered numerous compilation problems due to this rename. Why was this done?
Martijn
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
