Re: wicket-6 User friendly form validation with Wicket (stuq)
Hi all, We have been using the examples given in the FormsWithFlair for a while and it has been working very well. However, we recently migrated from wicket 1.5.x to 6.3.0 and the code didn't compile because of some api changes. Here's the code that worked in 1.5.x pre public class ValidationMsgBehavior extends AbstractBehavior { @Override public void onRendered(Component c) { FormComponent fc = (FormComponent) c; if (!fc.isValid()) { String error; if (fc.hasFeedbackMessage()) { error = fc.getFeedbackMessage().getMessage().toString(); } else { error = Your input is invalid.; } fc.getResponse().write( div class=\validationErrorMessage\ + error + /div); } } } /pre Am I right to say that I can replace AbstractBehavior with Behavior? But I'm not sure what will be the best way to handle the feedback messages related code. Is a call to hasFeedbackMessage() correct now or should we use a feedback collector here? getFeedbackMessage() has been removed so I have no choice but to use feedback collector to get it. On Tue, Nov 6, 2012 at 3:09 AM, Rafał Krupiński r.krupin...@gmail.comwrote: On 05.11.2012 17:01, Martin Grigorov wrote: See FormsWithFlair application and PDF at http://code.google.com/p/**londonwicket/downloads/listhttp://code.google.com/p/londonwicket/downloads/list It also shows how a behavior can be used for this. Thanks for the link, looks very promising. Best Regards Rafał Krupiński --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Thanks regards James Selvakumar
Re: wicket-6 User friendly form validation with Wicket (stuq)
Sorry, Got most of the answers from the mailing list discussion here: http://apache-wicket.1842946.n4.nabble.com/highlight-invalid-fields-with-custom-Validation-Framework-tp4652949p4652978.html On Mon, Nov 26, 2012 at 11:31 AM, James Selvakumar ja...@mcruncher.comwrote: Hi all, We have been using the examples given in the FormsWithFlair for a while and it has been working very well. However, we recently migrated from wicket 1.5.x to 6.3.0 and the code didn't compile because of some api changes. Here's the code that worked in 1.5.x pre public class ValidationMsgBehavior extends AbstractBehavior { @Override public void onRendered(Component c) { FormComponent fc = (FormComponent) c; if (!fc.isValid()) { String error; if (fc.hasFeedbackMessage()) { error = fc.getFeedbackMessage().getMessage().toString(); } else { error = Your input is invalid.; } fc.getResponse().write( div class=\validationErrorMessage\ + error + /div); } } } /pre Am I right to say that I can replace AbstractBehavior with Behavior? But I'm not sure what will be the best way to handle the feedback messages related code. Is a call to hasFeedbackMessage() correct now or should we use a feedback collector here? getFeedbackMessage() has been removed so I have no choice but to use feedback collector to get it. On Tue, Nov 6, 2012 at 3:09 AM, Rafał Krupiński r.krupin...@gmail.comwrote: On 05.11.2012 17:01, Martin Grigorov wrote: See FormsWithFlair application and PDF at http://code.google.com/p/**londonwicket/downloads/listhttp://code.google.com/p/londonwicket/downloads/list It also shows how a behavior can be used for this. Thanks for the link, looks very promising. Best Regards Rafał Krupiński --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Thanks regards James Selvakumar -- Thanks regards James Selvakumar
Re: wicket-6 User friendly form validation with Wicket (stuq)
See FormsWithFlair application and PDF at http://code.google.com/p/londonwicket/downloads/list It also shows how a behavior can be used for this. On Fri, Nov 2, 2012 at 9:58 PM, Rafał Krupiński r.krupin...@gmail.comwrote: On Mon, Oct 29, 2012 at 8:36 AM, Martin Grigorov mgrigo...@apache.org wrote: Anyway, I would like to have a label for each validated input field and put there any error messages related to that input. I haven't found any example other than that old article by Daan van Etten and that was for wicket 1.3. Daan's solution used his own FeedbackLabel class and filtered FeedbackPanel but it doesn't work with wicket 6. Please paste your code and compile errors/exceptions to see what doesn't work. Hi I haven't got any errors nor exceptions, feedback labels were ignored and all messages went to feedback panel. For the code see the site, it's back on-line. http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket -- Pozdrawiam / Best Regards Rafal Krupinski - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com http://jweekend.com/
Re: wicket-6 User friendly form validation with Wicket (stuq)
On 05.11.2012 17:01, Martin Grigorov wrote: See FormsWithFlair application and PDF at http://code.google.com/p/londonwicket/downloads/list It also shows how a behavior can be used for this. Thanks for the link, looks very promising. Best Regards Rafał Krupiński - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket-6 User friendly form validation with Wicket (stuq)
On Mon, Oct 29, 2012 at 8:36 AM, Martin Grigorov mgrigo...@apache.org wrote: Anyway, I would like to have a label for each validated input field and put there any error messages related to that input. I haven't found any example other than that old article by Daan van Etten and that was for wicket 1.3. Daan's solution used his own FeedbackLabel class and filtered FeedbackPanel but it doesn't work with wicket 6. Please paste your code and compile errors/exceptions to see what doesn't work. Hi I haven't got any errors nor exceptions, feedback labels were ignored and all messages went to feedback panel. For the code see the site, it's back on-line. http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket -- Pozdrawiam / Best Regards Rafal Krupinski - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket-6 User friendly form validation with Wicket (stuq)
Hi, On Sun, Oct 28, 2012 at 9:31 PM, Rafał Krupiński r.krupin...@gmail.com wrote: On Wed, Oct 24, 2012 at 10:13 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi, The URL below doesn't load and I cannot see what is his implementation. Hm, it loaded when I posted that message :( Anyway, I would like to have a label for each validated input field and put there any error messages related to that input. I haven't found any example other than that old article by Daan van Etten and that was for wicket 1.3. Daan's solution used his own FeedbackLabel class and filtered FeedbackPanel but it doesn't work with wicket 6. Please paste your code and compile errors/exceptions to see what doesn't work. -- Pozdrawiam / Best Regards Rafal Krupinski - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket-6 User friendly form validation with Wicket (stuq)
On Wed, Oct 24, 2012 at 10:13 AM, Martin Grigorov mgrigo...@apache.org wrote: Hi, The URL below doesn't load and I cannot see what is his implementation. Hm, it loaded when I posted that message :( Anyway, I would like to have a label for each validated input field and put there any error messages related to that input. I haven't found any example other than that old article by Daan van Etten and that was for wicket 1.3. Daan's solution used his own FeedbackLabel class and filtered FeedbackPanel but it doesn't work with wicket 6. -- Pozdrawiam / Best Regards Rafal Krupinski - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket-6 User friendly form validation with Wicket (stuq)
Hi, The URL below doesn't load and I cannot see what is his implementation. On Sat, Oct 20, 2012 at 10:34 PM, Rafał Krupiński r.krupin...@gmail.com wrote: Hi all! There is old article on putting validation messages near the input fields at http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket Is there a wicket-native method of doing this in wicket 6 or should I follow the article? Rafał - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org