It works, sorry, I was not paying enough attention. In the first phase I 
wasn't looking to the right form, the the second phase I forgot to add 
the 'return' in the 'onsubmit' form handler

Correct is *add(new SimpleAttributeModifier("onsubmit", "return 
confirmSubmission()"));* and it works with wicket 1.2 final.

Sorry for the trouble.

Dorel Vaida wrote:
> Eelco Hillenius wrote:
>   
>> Yeah do it like that. 
>>     
> The form is submitted no matter what I return in submit button's 
> onclick. Eventually the solution would be to add a simple button and NOT 
> a submit button and force submiting the form through javascript when 
> pressing the button.  (Which I do not like).
>   
>> I wouldn't know why attaching attribute
>> modifiers to your form didn't work though...
>>   
>>     
> Me neither, that's why I asked. I thought that in some way "onsubmit" 
> attribute is blocked by wicket being reserved for it's own use, 
> otherwise I do not see any reason why wicket wouldn't render a 
> 'onsubmit' attribute as it renders the others that fortunately do work 
> :-(. From what I know returning false in the form's "onsubmit" is the 
> standard way of elegantly preventing the form from being submitted.
>   
>> Eelco
>>
>>
>> On 7/17/06, Matej Knopp <[EMAIL PROTECTED]> wrote:
>>   
>>     
>>> I think you should add Button(s) to the form and add onclick attribute
>>> modifier on them (or right on to the markup <input type="submit"
>>> wicket:id="submit" onlick="return confirm('...');"/> )
>>>
>>> -Matej
>>>
>>> Dorel Vaida wrote:
>>>     
>>>       
>>>> I'm using wicket 1.2 final and trying to use the form's 'onsubmit'
>>>> handler to prompt the user to confirm a message or not. I've tried to
>>>> solve this by adding the "onsubmit" to the form with a
>>>> SimpleAttributeModifier but it doesn't work, the onsubmit attribute is
>>>> simply not rendered ?!
>>>>
>>>> If this isn't the way a form is supposed to be used, can anybody point
>>>> to how can I do such a thing ? (Ask a user, 'do you really want to
>>>> submit that form' when he presses submit)
>>>>
>>>> Thanks,
>>>> Dorel
>>>>
>>>>
>>>> -------------------------------------------------------------------------
>>>> Using Tomcat but need to do more? Need to support web services, security?
>>>> Get stuff done quickly with pre-integrated technology to make your job 
>>>> easier
>>>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>>> _______________________________________________
>>>> Wicket-user mailing list
>>>> Wicket-user@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>>>
>>>>       
>>>>         
>>> -------------------------------------------------------------------------
>>> Using Tomcat but need to do more? Need to support web services, security?
>>> Get stuff done quickly with pre-integrated technology to make your job 
>>> easier
>>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>> _______________________________________________
>>> Wicket-user mailing list
>>> Wicket-user@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>>
>>>     
>>>       
>> -------------------------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Wicket-user mailing list
>> Wicket-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>> __________ NOD32 1.1523 (20060505) Information __________
>>
>> This message was checked by NOD32 Antivirus System.
>> http://www.nod32.com
>>
>>
>>
>>   
>>     
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
> __________ NOD32 1.1523 (20060505) Information __________
>
> This message was checked by NOD32 Antivirus System.
> http://www.nod32.com
>
>
>
>   



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to