Announcement

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

    Enhancement: FormItem.setEnabledIfCondition() analogue to setShowIfCondition()

    Hi Isomorphic,

    I need to build something as your sample here. I also saw this sample which does the same for show/hide, but in a more declarative way with setShowIfCondition(FormItemIfFunction showIf).

    I'd suggest to add a similar function named setEnabledIfCondition(FormItemEnabledFunction enabledIf).

    This is only minor as there is another way to solve this use case.

    Best regards
    Blama

    #2
    Take a look at FormItem.enableWhen: you can set criteria for when an item is enabled based on automatically collected state in nearby DataBoundComponents.

    Given this feature, we probably will not add a second API that works in terms of a function - semantics for when the function should be consulted are not as clear as with the *when attributes.

    Comment


      #3
      Hi Isomorphic,

      there is no setEnableWhen in FormItem, only in the DynamicForm (inherited from Canvas).
      I also checked the 11.0 SmartClient docs - enableWhen is available on FormItemIcon, Tab, Canvas, MenuItem.

      Did I miss something?

      Best regards
      Blama

      Comment


        #4
        Sorry, the correct attribute is readOnlyWhen, which can then cause disabled appearance (or other presentations of read only fields) via readOnlyDisplay.

        Comment


          #5
          Hi Isomorphic,

          thank you. It was added in 6.0, but I'm long overdue to change here anyway. I'll do so and then use it.

          Best regards
          Blama

          Comment

          Working...
          X