Re: required field in a form, help :)
setDefaultFormProcessing(false) on your cancel buttom Regards Dipu On Nov 14, 2007 11:05 AM, raybristol [EMAIL PROTECTED] wrote: Hi, I have some inputs in a form, some are required field, they work fine when I press 'submit' button, however, I also include a cancel button, in which onclick event my code is like: add(new Button(cancel){ public void onClick() { setResponsePage(new ActivityTypeList()); } }); But I think it's probably button 'cancel' has attribute type='submit' in html page, but I can't put reset, so I don't know what to do to avoid the validation when user press 'cancel' ? Many thanks, Ray -- View this message in context: http://www.nabble.com/required-field-in-a-form%2C-help-%3A%29-tf4804178.html#a13744215 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: required field in a form, help :)
Read the JavaDoc of Button: One other option you should know of is the 'defaultFormProcessing' property of Button components. When you set this to false (default is true), all validation and formupdating is bypassed and the onSubmit method of that button is called directly, and the onSubmit method of the parent form is not called. A common use for this is to create a cancel button. Or search the archives: http://www.nabble.com/forum/Search.jtp?query=skip+form+validation+buttonlocal=yforum=13974 Martijn On 11/14/07, raybristol [EMAIL PROTECTED] wrote: Hi, I have some inputs in a form, some are required field, they work fine when I press 'submit' button, however, I also include a cancel button, in which onclick event my code is like: add(new Button(cancel){ public void onClick() { setResponsePage(new ActivityTypeList()); } }); But I think it's probably button 'cancel' has attribute type='submit' in html page, but I can't put reset, so I don't know what to do to avoid the validation when user press 'cancel' ? Many thanks, Ray -- View this message in context: http://www.nabble.com/required-field-in-a-form%2C-help-%3A%29-tf4804178.html#a13744215 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.0-rc1 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: required field in a form, help :)
Or just use a Link (tm) Martijn -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.0-rc1 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: required field in a form, help :)
Thansk very much, I finally use a Link instead, much better. Martijn Dashorst wrote: Read the JavaDoc of Button: One other option you should know of is the 'defaultFormProcessing' property of Button components. When you set this to false (default is true), all validation and formupdating is bypassed and the onSubmit method of that button is called directly, and the onSubmit method of the parent form is not called. A common use for this is to create a cancel button. Or search the archives: http://www.nabble.com/forum/Search.jtp?query=skip+form+validation+buttonlocal=yforum=13974 Martijn On 11/14/07, raybristol [EMAIL PROTECTED] wrote: Hi, I have some inputs in a form, some are required field, they work fine when I press 'submit' button, however, I also include a cancel button, in which onclick event my code is like: add(new Button(cancel){ public void onClick() { setResponsePage(new ActivityTypeList()); } }); But I think it's probably button 'cancel' has attribute type='submit' in html page, but I can't put reset, so I don't know what to do to avoid the validation when user press 'cancel' ? Many thanks, Ray -- View this message in context: http://www.nabble.com/required-field-in-a-form%2C-help-%3A%29-tf4804178.html#a13744215 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.0-rc1 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/required-field-in-a-form%2C-help-%3A%29-tf4804178.html#a13745654 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]