I have a problem with a SelectItem that sometimes displays the valuefield instead of the displayfield. The attached image shows an example where the field "Estimator" shows the valuefield (10) instead of the the displayfield (an email address) which it should display. This happes approx. 1/20 times.
the src for the selectitem:
I have also tried this manual way:
My datasource:
Can anyone help with this?
I use SmartGWT 3.0 and it occurs in all of the major browsers.
the src for the selectitem:
Code:
DataSource estimatorDS = DataSource.get("selectiveUsers"); SelectItem estimatorId = new SelectItem("estimatorId"); estimatorId.setTitle("Estimator"); estimatorId.setDisplayField("email"); estimatorId.setValueField("id"); estimatorId.setWidth(fieldWidth); estimatorId.setOptionDataSource(estimatorDS);
Code:
DataSource estimatorDS = DataSource.get("selectiveUsers"); estimatorDS.fetchData(null, new DSCallback() { @Override public void execute(DSResponse response, Object rawData, DSRequest request) { estimatorId.setValueMap((LinkedHashMap) response.getDataAsRecordList().getValueMap("id", "email")); } }); estimatorId = new SelectItem("estimatorId"); estimatorId.setTitle("Estimator"); estimatorId.setDisplayField("email"); estimatorId.setValueField("id"); estimatorId.setWidth(fieldWidth); estimatorId.setValueMap(estimators);
My datasource:
Code:
<DataSource ID="selectiveUsers" serverConstructor="com.emp.server.servlets.user.UserServlet"> <fields> <field name="id" type="sequence" hidden="true" primaryKey="true"/> <field name="userName" type="text" title="User Name" required="true" /> <field name="email" type="text" title="Email" required="true" /> </fields> </DataSource>
I use SmartGWT 3.0 and it occurs in all of the major browsers.
Comment