Scenario:
A SelectItem connected to a DataSource (viewSelectorItem.setOptionDataSource(myDS)):
On relogin, the last selected SelectItem should be restored.
The ID of the selected Item is saved in a cookie.
Unfortunately, SelectItem.getViewState() does not exist for SelectItem or the Form it is embedded in (someForm), so there must be another way to do this.
I tried the following:
	but got a
	error.
What is the recommended way to do this? Any other ideas?
Thanks
fatzopilot
					A SelectItem connected to a DataSource (viewSelectorItem.setOptionDataSource(myDS)):
On relogin, the last selected SelectItem should be restored.
The ID of the selected Item is saved in a cookie.
Unfortunately, SelectItem.getViewState() does not exist for SelectItem or the Form it is embedded in (someForm), so there must be another way to do this.
I tried the following:
Code:
	
	String SelectItem_lastValue = Cookies.getCookie("SelectItem_lastValue");
someForm.setDataSource(myDS);
someForm.fetchData();
RecordList recordList = someForm.getRecordList();
Record previouslySelected = recordList.find("recordID", SelectItem_lastValue);
Code:
	
	com.google.gwt.core.client.JavaScriptException: (TypeError): self.find is not a function
What is the recommended way to do this? Any other ideas?
Thanks
fatzopilot

Comment