GWT version: 2.4.0
Smart GWT version: 3.0 (smartgwt-3.0p)
SmartClient Version: 8.2/LGPL Development Only (built 2011-12-05)
Browser: Firefox 11.0
Operating System: Windows 7 Ultimate
GWT Development Mode
Hello,
When i create a PickList and set a ListGrid with a filter editor as its properties, any selections made with an active filter results in that selection becoming the new value (discarding previously selected records). If i remove the filter criteria after making this selection (showing all records) it seems the previously selected records are still selected, but this is not reflected by the PickList's value.
For example, I have a PickList item with a "name" field that has 4 values: John, Eddy, Michael and Alex. John and Eddy are selected. When I enter the text "Al" in the filter editor for the "name" field, values are filtered so that only Alex is shown. If I select this value, the value of the PickList becomes Alex, discarding John and Eddy. If i remove the text "Al" in the filter editor, the entire list of values is shown again, and John, Eddy and Alex are selected, but the value of the PickList item is still set to Alex.
Test case
user.data.xml
Smart GWT version: 3.0 (smartgwt-3.0p)
SmartClient Version: 8.2/LGPL Development Only (built 2011-12-05)
Browser: Firefox 11.0
Operating System: Windows 7 Ultimate
GWT Development Mode
Hello,
When i create a PickList and set a ListGrid with a filter editor as its properties, any selections made with an active filter results in that selection becoming the new value (discarding previously selected records). If i remove the filter criteria after making this selection (showing all records) it seems the previously selected records are still selected, but this is not reflected by the PickList's value.
For example, I have a PickList item with a "name" field that has 4 values: John, Eddy, Michael and Alex. John and Eddy are selected. When I enter the text "Al" in the filter editor for the "name" field, values are filtered so that only Alex is shown. If I select this value, the value of the PickList becomes Alex, discarding John and Eddy. If i remove the text "Al" in the filter editor, the entire list of values is shown again, and John, Eddy and Alex are selected, but the value of the PickList item is still set to Alex.
Test case
Code:
package com.project.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.fields.DataSourceIntegerField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.types.Autofit; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; public class Project implements EntryPoint { private static class UserXmlDS extends DataSource { private static UserXmlDS instance = null; public static UserXmlDS getInstance() { if (instance == null) { instance = new UserXmlDS("userXmlDS"); } return instance; } public UserXmlDS(String id) { setID(id); setRecordXPath("/List/user"); DataSourceIntegerField pkField = new DataSourceIntegerField("id", "ID"); pkField.setPrimaryKey(true); DataSourceTextField nameField = new DataSourceTextField("name", "Name"); setFields(pkField, nameField); setDataURL("test_data/user.data.xml"); setClientOnly(true); } } public void onModuleLoad() { UserXmlDS ds = UserXmlDS.getInstance(); ListGrid userSelectProperties = new ListGrid(); userSelectProperties.setShowFilterEditor(true); userSelectProperties.setFilterOnKeypress(true); ListGridField nameField = new ListGridField("name"); SelectItem userSelect = new SelectItem("users", "Users"); userSelect.setDisplayField("name"); userSelect.setValueField("id"); userSelect.setOptionDataSource(ds); userSelect.setFilterLocally(true); userSelect.setMultiple(true); userSelect.setPickListFields(nameField); userSelect.setPickListProperties(userSelectProperties); DynamicForm userForm = new DynamicForm(); userForm.setFields(userSelect); userForm.draw(); } }
Code:
<List> <user> <id>1</id> <name>John</name> </user> <user> <id>2</id> <name>Eddy</name> </user> <user> <id>3</id> <name>Michael</name> </user> <user> <id>4</id> <name>Alex</name> </user> </List>
Comment