I think this works really great right now in Wicket. If you want to do anything with the form, you use formSubmit and a submit button. If not, you use other components, like links.
Eelco
Martijn Dashorst wrote:
I find the name OnClickLink not very comforting for a Form component. I'd expect a button component which does this for me. Perhaps a new extension for the html.form package?
It is now not clear how to do this. The Form documentation could also use some information on handling submits other than 'the onSubmit is handled in subclasses.'.
Martijn
Eelco Hillenius wrote:
Actually, things like: getRequestCycle().getRequest().getParameter("save") != null to signal whether a submit or cancel was pressed, typically comes from the non-component based approach, where all form submits would enter the same action. If you think about what you want to do here... it has nothing to do with really submitting the form, as you just want to navigate somewhere else.
I admit, it is partially my fault as checking on the cancel button was in CDAPP (which you copied?), but it is one of the things I had to learn. Compare it to how you would do it in e.g. Swing. A cancel button would then also just have a navigation action.
Eelco
Eelco Hillenius wrote:
It's much better to use a seperate button, like currently in CDAPP.
Java:
add(new OnClickLink("cancelButton") { public void linkClicked() { getRequestCycle().setPage(getSearchPage()); } });
Html:
<input type="button" id="wicket-cancelButton" value="cancel"/>
<input type="submit" value="save"/>
Eelco
Martijn Dashorst wrote:
Is there a more elegant way to determine which button was clicked when the onSubmit occurs?
Currently the only way I know is to go into the request parameters: getRequestCycle().getRequest().getParameter("save") != null
Perhaps instead of an onSubmit on the form, an onClick on each button added?
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-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
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-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------- 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-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------- 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-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------- 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-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user