Hi,

Please file a ticket. I agree that Wicket can use
Behavior#isEnabled(Component) to decide whether to call
I(Form)Validator#validate().

To workaround it you can use normal IValidator added to the always visible
form component and pass manually the one that may be invisible. This way
you have all the information to decide whether everything is valid.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov


On Fri, Jul 25, 2014 at 3:52 AM, Joachim Schrod <[email protected]> wrote:

> Hi,
>
> I have a form with a date input that may be invisible. If it is
> visible, its value must be after another date input's value.
>
> I established a FormValidator that checks that condition. It knows
> about the potential invisibility and handles it.
>
> Now, for most pages Wicket outputs the warning
>
>     IFormValidator in form `form` depends on a component that has
>     been removed from the page or is no longer visible. Offending
>     component id `inhaber1.arbeitSeit`.
>
> I thought about disabling the FormValidator if its dependent
> component is invisible -- but then I realized that isEnabled() of
> validator-behaviors is not checked and that's not the route to go.
>
> FWIW, I think that's a mis-feature.
> Form.validateFormValidator(IFormValidator) should check
> isEnabled(). Checking isEnabled() also in
> FormComponent.validateValidators() is a different question, I can't
> find a use case for it.
>
> Thus, my question: how may I realize checks over several form
> components where one of them may be invisible?
>
> Here's hoping for a hint in the right direction,
>
>         Joachim
>
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Joachim Schrod, Roedermark, Germany
> Email: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to