Using SC_SNAPSHOT-2011-01-06/EVAL Deployment 2011-01-06
I have a ListGridField that takes multiple keys from another data source, using one field for display and one field for values (the values are the keys).
When a single value is selected it works fine and shows the 'displayField' value. When multiple values are selected, it shows the keys instead.
Seems like a bug to me. Glad to be wrong though.
Here's a test case. Try selecting a single value. Then try multiple values.
I have a ListGridField that takes multiple keys from another data source, using one field for display and one field for values (the values are the keys).
When a single value is selected it works fine and shows the 'displayField' value. When multiple values are selected, it shows the keys instead.
Seems like a bug to me. Glad to be wrong though.
Here's a test case. Try selecting a single value. Then try multiple values.
Code:
DataSource ds = new DataSource("optionDS"); ds.setClientOnly(true); DataSourceField keyField = new DataSourceTextField("key"); keyField.setPrimaryKey(true); DataSourceField valueField = new DataSourceTextField("value"); ds.addField(keyField); ds.addField(valueField); DataSource ds2 = new DataSource("mainDS"); ds2.setClientOnly(true); DataSourceTextField key2 = new DataSourceTextField("key2"); key2.setPrimaryKey(true); DataSourceTextField values = new DataSourceTextField("values"); values.setMultiple(true); ds2.addField(key2); ds2.addField(values); for (int i = 0; i < 3; i++) { Record optionRecord = new Record(); optionRecord.setAttribute(keyField.getName(), "someKey" + i); optionRecord.setAttribute(valueField.getName(), "someValue" + i); ds.addData(optionRecord); } ListGridField field = new ListGridField("values"); field.setMultiple(true); field.setOptionDataSource(ds); field.setValueField("key"); field.setDisplayField("value"); ListGrid grid = new ListGrid(); grid.setFields(field); grid.setDataSource(ds2); grid.setCanEdit(true); grid.draw(); grid.startEditingNew();
Comment