Hi, Validators became Behaviors [1] post factum [2]. I think it is a good idea to make use of #isEnabled() for them too. Please file a ticket at JIRA. Thanks!
1. https://github.com/apache/wicket/blob/b4f69ac3492506c9841ad5c7cfc16a163d1df3d3/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java#L525 2. https://issues.apache.org/jira/browse/WICKET-3214 Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed, Apr 29, 2015 at 11:18 AM, Collinson, Alasdair < [email protected]> wrote: > Hi! > > In a component I'm developing, there's an AbstractRangeValidator which > should only be used under certain conditions. Since this is also a Behavior > I would have expected overriding Behavior#isEnabled(Component) would > deactivate the validator whenever we return false here. However, in > FormComponent#validateValidators() there is no reference to > Behavior#isEnabled(Component) and the validator is processed. Is this a bug > or is that feature meant for something completely different? If so, what > would be the best way to enable a validator only in certain conditions? > > Thanks a lot, > Alasdair > > Alasdair Collinson > ______________________________ > Senacor Technologies AG > Joseph-Schumpeter-Allee 1 > 53227 Bonn > > T +49 (228) 7636 - 247 > F +49 (228) 7636 - 100 > M +49 (171) 30 19 990 > > [email protected] > www.senacor.com > > > Senacor Technologies Aktiengesellschaft - Sitz: Schwaig b. Nbg. - > Amtsgericht Nbg.- Reg.-Nr.: HRB 23098 > Vorstand: Matthias Tomann, Marcus Purzer - Aufsichtsratsvorsitzender: > Mathias J. Lindermeir > > Diese E-Mail inklusive Anlagen enth?lt vertrauliche und/oder rechtlich > gesch?tzte Informationen. Wenn Sie > nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten, > informieren Sie bitte den Absender > und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die > unbefugte Weitergabe dieser E-Mail ist > nicht gestattet. > > This e-mail including any attachments may contain confidential and/or > privileged information. If you are > not the intended recipient (or have received this e-mail in error) please > notify the sender immediately and > destroy this e-mail. Any unauthorized copying, disclosure or distribution > of the materials in this e-mail is > strictly forbidden. >
