weixin_39918128 2020-11-20 13:09
浏览 0

Adding deregister/unregister to ValidationSupport

Original report by Hadi Fakhreddin (Bitbucket: hadifa, GitHub: hadifa).

Hi team,

Looking in ValidationSupport, there doesn't seem to be a way to remove a Control or a Validator after registering it with ValidationSupport.

Validator v = Validator.createEmptyValidator("control is required") validationSupport.registerValidator(control, v);

then It would be nice to be able to deregister using some of the following (whichever ones make sense): validationSupport.deregisterValidator(v) // deregister the validator or validationSupport.deregisterValidator(control) // deregister the control or validationSupport.deregisterValidator(control,v) // deregister the validator from control

I have a form that the validation rules for controls are set dynamically. For example doctor selection from drop down is mandatory unless "All Doctors" checkbox is selected. As a result I want to be able to deregister the validator for doctor dropdown when "All Doctors" is selected and register it again when the checkbox is deselected.

该提问来源于开源项目:controlsfx/controlsfx

  • 写回答

11条回答 默认 最新

  • weixin_39918128 2020-11-20 13:09
    关注

    Original comment by Shanaka Perera (Bitbucket: shanaka08, GitHub: Unknown).

    I really miss this Unregistering feature. It is truly useful in most of the form submission scenarios.

    评论

报告相同问题?