RE: Conditional validation without overriding isRequired

2012-06-06 Thread Schlärmann , Bob
Thanks for your reply, Argh, confused setVisible() with setRequired, my bad ;-) But nevertheless: call setRequiered(condition) in onConfigure(). I've tried this but if I am correct isRequired() gets called before onConfigure() during the request cycle (at least this is the behaviour I see

Re: Conditional validation without overriding isRequired

2012-06-06 Thread Andrea Del Bene
Hi, you can consider to override form's process() method. Before calling the super version you can check for the radio value and set the other fields as required if the specific value was chosen. Thanks for your reply, Argh, confused setVisible() with setRequired, my bad ;-) But

RE: Conditional validation without overriding isRequired

2012-06-06 Thread Sven Meier
You have to use the input or converted input of the field. See https://cwiki.apache.org/WICKET/conditional-validation.html for inspirations. Sven Schlärmann, Bob bob.schlarm...@logica.com schrieb: Thanks for your reply, Argh, confused setVisible() with setRequired, my bad ;-) But

RE: Conditional validation without overriding isRequired

2012-06-06 Thread Schlärmann , Bob
Thanks for all the comments. I'm implementing the conditional validation using a custom form processing method as suggested by Andrea. It's implemented as a form and behavior subclass. The overridden Form#process() first visits all form components and executes a special method on the

Conditional validation without overriding isRequired

2012-06-05 Thread Schlärmann , Bob
Hello, A question about form processing: is it possible to do conditional form validation without overriding FormComponent#isRequired? I have a form with about 5 different form components (e.g. textfields, dropdown, radiobutton). These fields are only required if a RadioGroup has a certain

Re: Conditional validation without overriding isRequired

2012-06-05 Thread Thomas Götz
Yes, you can also push the state instead of pulling it, which besides is preferrable in terms of efficiency (as onConfigure() is only called once per request whereas isVisible() is potentially called many time): TextFieldString textField = new TextFieldString(textField) { @Override

Re: Conditional validation without overriding isRequired

2012-06-05 Thread Thomas Götz
Argh, confused setVisible() with setRequired, my bad ;-) But nevertheless: call setRequiered(condition) in onConfigure(). -Tom Thomas Götz wrote: Yes, you can also push the state instead of pulling it, which besides is preferrable in terms of efficiency (as onConfigure() is only called