wicket handles this for you with submit buttons. any Button you add to the form has its own onSubmit() you can override. if you want to skip validation,etc call setDefaultFormProcessing(false) on that button.

if you still want to add _javascript_ there are two ways to do it

1) use an attribute modifier, ie
button.add(new SimpleAttributeModifier("onclick", "myjavascript");
also see AttributeModifier for more complex usecases

2) override button's onComponentTag and call
tag.getAttributes().put("onclick", "_javascript_");

-Igor


On 6/13/06, Pierre de Fermat < [EMAIL PROTECTED]> wrote:
I have a button in a form.
I want to add an onclick event handler to the button as well to handle the button.onSubmit() on the server side. How do I add the onclick attribute ?



_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to