Announcement

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

    Accessing whole data row in optionDataSource's picklist on SelectItem change

    Hi Isomorphic,

    I have a DynamicForm where I want to disable some FormItems if a SelectItem in the form changes to some specific (yet not static) values.

    The SelectItem has a setOptionDataSource() and also setPickListFields() with some hidden ListGridFields.

    The value I decide on whether to hide FormItems in the DynamicForm is not the valueField of the SelectItem, but one of the hidden columns.

    Example SelectItem data:
    Code:
    [B]id  text            won_lost(hidden)[/B]
    1   Won             w
    2   Lost-price      l
    3   Lost-competitor l
    id is the valueField, won_lost is hidden. On won_lost="l" I want to do my changedHandler actions.

    How do I get this value best (using current 5.0p)?

    Thank you & Best regards
    Blama

    #2
    SelectItem.getSelectedRecord() will allow you to get the entire related Record if the SelectItem has loaded it, which will generally be the case if either the user selected the record from the pickList, or if the fetchMissingValues behavior has kicked in to fetch display values.

    If the record doesn't happen to already have been loaded in this way, you will need to use DataSource.fetchData() to fetch it, using the primaryKey value from the valueField as part of the criteria so that only the one record is returned.

    Comment


      #3
      Hi Isomorphic

      thanks, that is the information I was looking for.

      Best regards
      Blama

      Comment

      Working...
      X