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 behavior.
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" schrieb:
>Thanks for your reply,
>
>> Argh, confused setVisible() with setRequired, my bad ;-)
>> But nevertheless: call setRequi
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 nevertheless
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
d
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
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):
TextField textField = new TextField("textField") {
@Override
protected void