Announcement

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

    problem with selectItem in listgrid

    Hi,
    I am having an issue when selecting data from selectitem. I attached selectitem to the listgrid field. For the select item i added value field and display field seperately. Initially when loading the data in selectitem shows correctly(shows the name), but when I edited the record, changed the value in selectitem..then the listgridfield shows "id"(setValueField("id")) but not "name"( setDisplayField("name");)

    Please let me know how can I solve it.


    Below is the code that I used to create a selectitem
    DataSource locationDS = LocationGwtRpcDataSource.getInstance();

    ListGridField type = new ListGridField("locationType");
    type.setWidth(50);
    ListGridField location = new ListGridField("name");
    setWidth(200);
    setOptionDataSource(locationDS);
    setValueField("id");
    setDisplayField("name");
    setPickListWidth(350);
    setPickListFields(type, location);


    Below is the code in ListGrid class..

    LocationSelectItem locationSelect = new LocationSelectItem();

    final ListGridField location = new ListGridField("locationName");
    location.setEditorType(locationSelect);
    location.setWidth(locationSelect.getWidth());
    location.setCanEdit(true);


    Thanks,
    Smartgwtuser.
Working...
X