SmartGWT 2.4
GWT 2.1
Firefox 3.6.15
Win XP
I have a ListGrid in an upper panel for display and a DynamicForm in the lower panel for editing. When a row is selected in the ListGrid, in the onSelectionChangedHandler() I editSelectedData() from the grid. I have two SelectItems in the form which have optionDataSources and to which I apply criteria (setOptionCriteria) in the same onSelectionChangedHandler(). From the logs it is clear that the optionDataSources() automatically perform their
fetch()'s as expected and return the proper number of rows.
If I simply press the Update button, which executes a form.saveData() the update fails because the values returned from the SelectItems are the display values rather than the id values. However, if I click on each of the picker icons without changing the selections before I press the Update button the update works fine. The onChanged events of the SelectItems do fire when I click on the picker icons but they are not doing new fetches from the server.
This seems like a common use case, so I assume that I am doing something wrong. I have tried putting the editSelectedData() after I set the optionDataSource criteria but that seems to cause the picklists to display ‘No Items To Show’.
The closest example I could find in the showcase does not use setOptionCriteria rather it overrides getPickListFilterCriteria in the SelectItem. I tried this and it made no difference.
So, two questions:
- After calling editSelectedData(), what do I need to do to get the SelectItems to return the Values instead of DisplayValues?
- What actions/events tigger an automatic fetch of the optionDataSource. I had assumed that it was setOptionCriteria, but the showcase example doesn’t even use that method?
Thanks,
John