Here's the easiest way that I can think of.... Create a behavior (extend AbstractBehavior) that assigns a class to the form component of either "error" or "noerror" based on the component status.
Then, if you don't want to manually add it to every form component, I think you could add a visitor to the form that adds the behavior to all form components for you. This is (IMHO) a better solution than JS - it works on the server side. -- Jeremy Thomerson http://www.wickettraining.com On Fri, Dec 5, 2008 at 7:08 PM, novotny <[EMAIL PROTECTED]> wrote: > > Hi, > > I have markup like <li class="noerror">Enter text<input type="text" > wicket:id="sometext"/>.... > > And I'm using FeedbackPanel currently, but instead of showing all the > errors > at the top, we want to change class="noerror" to class="error" which seems > easier to do in javascript. But how can I indicate to wicket to invoke this > javascript function which changes class="noerror" to class="error" for > those > fields that have errrors? > I'm open to other ideas, but I have lots of wicket panels and don't want to > have to add a lot more wicket code to every class e.g. doing <li > wicket:id=...> in markup and adding RepeatingView/Label solutions seems > like > more work. > > Thanks, Jason > -- > View this message in context: > http://www.nabble.com/how-to-invoke-javascript-method-after-form-validation--tp20865454p20865454.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
