Hi,
In the following test case:
using these xml data files:
Employment.xml
Department.xml
Running this test case shows that employer field drop-down list has 2 columns: id and code:
This is correct - defaultItem.setPickListFields(new ListGridField("id"), new ListGridField("code"));
as underlined in test case.
The problem is that if user changes operator from "eqals" to "not equal", then drop-down list has only 1 column:
Also, changing operator to "equals" again, shows only 1 column:
This is tested against the most current 6.0p version:
SmartClient Version: v11.0p_2016-06-07/LGPL Development Only (built 2016-06-07)
Developer console shows no warning nor errors.
MichalG
In the following test case:
Code:
package pl.com.tech4.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.DOM; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.DataSourceField; import com.smartgwt.client.data.OperationBinding; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.types.DSDataFormat; import com.smartgwt.client.types.DSOperationType; import com.smartgwt.client.types.DSProtocol; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.form.FilterBuilder; import com.smartgwt.client.widgets.form.fields.ComboBoxItem; import com.smartgwt.client.widgets.grid.ListGridField; public class MainEntryPoint implements EntryPoint { public void onModuleLoad() { DOM.getElementById("loadingPicture").removeFromParent(); layout(); SC.showConsole(); } private void layout() { DataSource employmentDS = new DataSource(); employmentDS.setID("Employment"); OperationBinding fetchBinding = new OperationBinding(); fetchBinding.setOperationType(DSOperationType.FETCH); fetchBinding.setDataFormat(DSDataFormat.XML); fetchBinding.setDataProtocol(DSProtocol.POSTXML); employmentDS.setOperationBindings(fetchBinding); employmentDS.setDataURL("Employment.xml"); DataSource departmentDS = new DataSource(); departmentDS.setID("Department"); departmentDS.setOperationBindings(fetchBinding); departmentDS.setDataURL("Department.xml"); DataSourceField idDepField = new DataSourceField(); idDepField.setName("id"); idDepField.setPrimaryKey(true); idDepField.setHidden(true); DataSourceTextField codeField = new DataSourceTextField(); codeField.setName("code"); departmentDS.setFields(idDepField, codeField); DataSourceField idField = new DataSourceField(); idField.setName("id"); idField.setPrimaryKey(true); idField.setHidden(true); DataSourceField employerField = new DataSourceField(); employerField.setName("employer"); employerField.setForeignKey("Department.id"); employerField.setValueXPath("employer/id"); ComboBoxItem defaultItem = new ComboBoxItem("employer"); defaultItem.setOptionDataSource(departmentDS); defaultItem.setValueField("id"); defaultItem.setDisplayField("code"); [U]defaultItem.setPickListFields(new ListGridField("id"), new ListGridField("code"));[/U] [B]employerField.setEditorProperties(defaultItem);[/B] employmentDS.setFields(idField, employerField); FilterBuilder fb = new FilterBuilder(); fb.setDataSource(employmentDS); fb.draw(); } }
Employment.xml
Code:
<response> <status>STATUS_SUCCESS</status> <startRow>0</startRow> <endRow>1</endRow> <totalRows>2</totalRows> <data> <Employment> <id>20</id> <employer> <id>3</id> <code>Microsoft</code> </employer> </Employment> <Employment> <id>21</id> <employer> <id>4</id> <code>Apple</code> </employer> </Employment> </data> </response>
Code:
<response> <status>STATUS_SUCCESS</status> <startRow>0</startRow> <endRow>4</endRow> <totalRows>5</totalRows> <data> <Department> <id>1</id> <code>Oracle</code> <parentId> <id>2</id> <code>Sun</code> </parentId> </Department> <Department> <id>2</id> <code>Sun</code> <parentId> <id>2</id> <code>Sun</code> </parentId> </Department> <Department> <id>3</id> <code>Microsoft</code> <parentId> <id>2</id> <code>Sun</code> </parentId> </Department> <Department> <id>4</id> <code>Apple</code> <parentId> <id>2</id> <code>Sun</code> </parentId> </Department> </data> </response>
This is correct - defaultItem.setPickListFields(new ListGridField("id"), new ListGridField("code"));
as underlined in test case.
The problem is that if user changes operator from "eqals" to "not equal", then drop-down list has only 1 column:
Also, changing operator to "equals" again, shows only 1 column:
This is tested against the most current 6.0p version:
SmartClient Version: v11.0p_2016-06-07/LGPL Development Only (built 2016-06-07)
Developer console shows no warning nor errors.
MichalG
Comment