When using a SelectOtherItem in the new awesome ListGridEditorCustomizer something strange happens: When you open the item at first and select a value (that is not "Other") and then try to select a second time: the SelectOtherItem fetches on the datasource of the grid. So in this case suddenly the SelectOtherItem contains all the content records.
This was tested on SmartGWT Power 2.5, GWT 2.1.0 and Internet explorer 9
This was tested on SmartGWT Power 2.5, GWT 2.1.0 and Internet explorer 9
Code:
package test.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.form.fields.SelectOtherItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridEditorContext; import com.smartgwt.client.widgets.grid.ListGridEditorCustomizer; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; /** * Entry point classes define <code>onModuleLoad()</code>. */ public class Test implements EntryPoint { private VLayout vlayout = new VLayout(); private HLayout hlayout = new HLayout(); private ListGrid listGrid = new ListGrid(); public void onModuleLoad() { vlayout.setWidth100(); vlayout.setHeight100(); listGrid.setDataSource(DataSource.get("Content")); listGrid.setAutoFetchData(true); listGrid.setCanEdit(true); listGrid.setEditorCustomizer(new ListGridEditorCustomizer() { @Override public FormItem getEditor(ListGridEditorContext context) { SelectOtherItem selectOtherItem = new SelectOtherItem(); selectOtherItem.setValueMap("1", "two", "III"); selectOtherItem.setEmptyDisplayValue("Choose value"); return selectOtherItem; } }); hlayout.addMember(listGrid); vlayout.addMember(hlayout); vlayout.draw(); } }
Code:
<DataSource ID="Content" tableName="Content" serverType="sql" > <fields> <field name="cntn_pk" type="sequence" primaryKey="true"/> <field name="cntn_id" title="Id" type="text"/> </fields> </DataSource>
Comment