Validation is there to protect your domain objects from invalid data. Now you want to bypass this?
Adding a new record to a list should not trigger model updates. It should just add the thing and repaint the container with the added item. If you use a (ajax)submit(link|button) you can setDefaultFormProcessing(false) on the button/link and wicket will not validate nor update model values, but keep the input of the user so it can be validated at actual form submission. Martijn On Fri, Dec 19, 2008 at 1:20 PM, Kaspar Fischer <[email protected]> wrote: > I have a custom component that allows the user to select one or more > tags. For this, the component has a text field and an AjaxButton "Add" > to add a tag. > > All works fine if I use the component in a form without validation > errors. If, however, a text field has setRequired(true), the > AjaxButton's onSubmit() method is not called (but onError() instead). > > In this case, I do not want this behaviour but want form validation > to be disabled for the "Add" AjaxButton. (I still need to get the > model values updated, though.) > > Is there an easy way to achieve this? > > I've read about conditional validation, > > http://cwiki.apache.org/WICKET/conditional-validation.html > > but as my component does not know about the enclosing form, I am > looking for another solution. > > Many thanks, > Kaspar > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.4 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
