Announcement

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

    ComboBoxItem.setOptionDataSource & sort

    Hi,
    Code:
            ComboBoxItem item = new ComboBoxItem("item");
            item.setOptionDataSource(DS.getInstance());
            item.setDisplayField("name");
            item.setValueField("id");
    How to set sort by name for above drop-down combobox ?

    There is something like pickListProperties mentioned in the Smartclient docs, but I have no idea how to use it in smartgwt.

    Or item.setPickListCriteria is the way to go ?

    MichalG

    #2
    You could use pickListProperties via JSNI. If you don't understand how to do so, consider also operationOperationId (inherited from FormItem) in conjunction with an override of transformRequest() that sets sortBy on the DSRequest when DSRequest.operationId has the value you set on this ComboBox.

    We'll add an SGWT shortcut for this.

    Comment


      #3
      Thanks.
      I found out that:
      Code:
      DSRequest dsr = new DSRequest();
      dsr.setSortBy("name");
      item.setPickListCriteria(dsr);
      do what I wanted.
      MichalG

      Comment

      Working...
      X