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

    enableIf in Forms

    I'm evaluating SmartClient/GWT as a replacement for our current JS library inside our ERP software. I appreciate you have a showIf property for fields that allows a developer to specify visibility in a declarative manner. This is the way our development framework (in house developed) works. Our framework also allows us to define declaratively if a field is editable. In order to map this to SmartClient it would be very useful to have an enableIf property in addition to the existing showIf property. I presume it would not be so difficult to implement. I think it may be very useful to many customers. It is a frequent requirement to enable/disable a field based on the content of other fields and doing this with callback functions is cumbersome.

    Thank you.

    an equivalent of ListGrid.canEditCell would be a welcome addition :-)


      We've actually gone well beyond this in SmartClient 11.0 / SmartGWT 6.0 - there is now a formItem.readOnlyWhen property that allows you to control editability declaratively, based on values in the surround form and other nearby DataBoundComponents.

      Note that controlling whether something is read-only is tantamount to controlling whether it's enabled, as enabled is just one of the possibly appearances for a read-only control (see formItem.readOnlyDisplay.


        I saw the #enabledAndVisibilityRulesNewSample and the #formRulesNewSample samples, and I think they're great additions, for the code maintainability also.
        I would like to try them, but the docs aren't updated, will you please update this thread when they are?