Hello team,
I have a SelectItem in a form and I used setOptionDataSource on that SelectItem. The datasource is RPC datasource and so in the datasource i am making a service call to get the data from the backend. When I click on the AnalyisType dropdown it says Loading Data…and does not show the values. Can you please help?
-
SmartGWT version -2.4 and Firefox-3.6;
-
MyDataSource datasource = new DataSource(); DynamicForm form = new DynamicForm(); final SelectItem analysisTypeItem = new SelectItem(); analysisTypeItem.setName("analysisType"); analysisTypeItem.setTitle("Select an Analysis Type"); analysisTypeItem.setRequired(true); analysisTypeItem.setOptionDataSource(datasource); form.setFields(analysisTypeItem); -
MyDataSource constructor code below:
public MyDataSource() {
final DataSourceTextField analysisTypeField = new DataSourceTextField (“analysisType”, “Select an Analysis Type for this Transfer”);
analysisTypeField.setRequired(true);
analysisTypeField.setMultiple(false);
service.getAnalysisType(new AsyncCallback<HashMap<String, String>>() {
public void onFailure(Throwable caught) {
GWT.log("Failed to get the studies");
}
public void onSuccess(HashMap<String, String> result) {
analysisTypeField.setValueMap((LinkedHashMap<String, String>) result);
}
});
}
Thanks
BS