Announcement

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

    #16
    We've taken a look at what's going on here, and the short answer is this:
    You're calling 'setValue(...)' and passing in the display value for an item rather than the data value (in other words "ABrand" rather than "01").
    This is probably just an app level coding error as your application code would want to work with the underlying data values rather than the display values. If you setValue() to the data value ("01", say) things will work as expected.

    Longer answer: The "empty row" in the pickList isn't actually empty - it represents the current item value, but has no 'displayField' mapping so appears empty to the user.

    The pickList is actually a specialized listGrid and shows an array of records. If you're bound to an optionDataSource, the records are derived from that dataSource, if not they're populated on the client via "getPickListClientData()".
    By default if a "displayField" is specified for the item, that's the field that is shown to the user in the pickList [if not the "valueField" is shown]. See SelectItem.getPickListFields()/setPickListFields() for more on this.

    The getClientPickListData() automatically builds records based on the specified valueMap, so if you have an explicit valueField and displayField, the valueField for each record in the pickList is populated with the key values from the valueMap, and the displayField is populated with the corresponding attribute values from the map.
    There also will always be an auto-generated entry for the current value of the item if it doesn't match any entries in the set of records derived from the valueMap. That's the entry you're seeing that appears blank, since there's an explicitly specified displayField, but this auto-generated entry doesn't populate that field by default.

    So this is something of an edge case where you're doing an unexpected usage (having an explicit valueField/displayField pair and setting to a data value that has no equivalent display value), and ending up with what looks like an empty row in the UI.

    We'll take a look at handling this case better in the framework but for now your solution is simple: set the value to a valid data value from the list of options, rather than to a display value [or remove the "displayField" specification on your item]

    Regards
    Isomorphic Software

    Comment


      #17
      Thanks,
      That helped..!!

      Comment

      Working...
      X