I would like to create a custom validator called disabledIf that functions (not surprisingly) like the provided requiredIf validator. I assume this is relatively simple, but I couldn’t find an example in the docs on how to do this. Can you provide me with a code snippet for this? Thanks.
Well, flipping the disabled bit of the field isn’t really a validator because validators run when validate() is called and I’m guessing that you want disabledIf to apply on draw.
This would probably be a feature that we would add in a future release. If you wanted something like this now, you could make a custom subclass of DynamicForm and override the draw() method to iterate through the fields, evaluating the disabledIf string and calling formItem.setDisabled() with the result. Remember to then call the superclass implemention of draw() on the form.