Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Validator applyWhen

    I have access to a CustomValidator called IntegerFieldRangeValidator, which checks if an item is within a certain integer range of 2 other fields. I'm trying to use it to validate an item only if a third field is a certain value. Specifically, I tried to write another CustomValidator that checks the third field's value and then if it's the certain value, tries to use the IntegerFieldRangeValidator's condition method but can't because it's protected.

    In the Validator.setDependentFields javadoc, it mentions an applyWhen criteria. That looks like what I'm trying to achieve, but I don't see anything else about it.

    Any ideas?

    Thanks!

    SmartGWT 2.5p in FF

    #2
    The simplest thing here is just to define a new CustomValidator with the behavior you want, invoking the logic of the IntegerFieldRangeValidator in order to re-use it.

    Comment

    Working...
    X