Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Bean Cross validation for plugins ? #3675

benprim ·
So I have an optional field in one of my plugins and needs to be filled only if another field is set
I tried implementing a class level constraint ... but it doesn't look like been checked.
If I change my constraint to a method level contraint it works.
... i'm no bean expert so may miss something, but I don't know either if it can come from a Quickbuild limitation...

Thanks a lot <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
  • replies 4
  • views 3709
  • stars 0
robinshen ADMIN ·
You may have your bean implementing Validatable interface, and then in the validate method do the mutual validation. The SystemSetting class in QB source code provides an example for that.
benprim ·
Thanks a lot Robin !
Works like a charm <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
By the way, is there a way to toggle the display of a field only if another one is enabled ?
robinshen ADMIN ·
You may design a child bean to include the dependent field, and once the child bean is enabled, then you can continue to edit the field in that child bean.
benprim ·
Great thanks Robin !