Friday, June 10, 2016

Dexterity - SetBooleanProperty() for FIELD_PROP_REQUIRED is not working

Problem
I have a field that i need to be ignored when required() is called in certain situations. So I tried to use SetBooleanProperty(fieldName, FIELD_PROP_REQUIRED, false) on the field, then setting it to true after the situation.

For some reason this did not change the property, and I have no clue why. It's probably undocumented Dex behavior.

Solution
Lock and unlock the field instead of using SetBooleanProperty(). Lock it before required() is used, and unlock it after.

Ref: From the Dex manual it says required() ignores fields that are locked, disabled, or hidden.

No comments:

Post a Comment

There was an error in this gadget