Hi Isomorphic,
please see this BuiltInDS based testcase (v10.1p_2015-12-18).
BuiltInDS.java:
Trying with and without Gender.setFilterEditorProperties(props); will give you the result from the screenshot:

My expectation would be that as the generated item is a SelectItem and not a ComboBoxItem or TextItem, that the used operator is "equals" by default. This is not true, but could be seen as minor enhancement, only.
What I do not understand is that the operatorId used for "MaritalStatus" changes once I change the operatorId for "Gender".
This has no priority for me, I just noticed it while creating an other testcase.
Best regards
Blama
please see this BuiltInDS based testcase (v10.1p_2015-12-18).
BuiltInDS.java:
Code:
package com.smartgwt.sample.client;
import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.types.OperatorId;
import com.smartgwt.client.util.Page;
import com.smartgwt.client.util.PageKeyHandler;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.layout.VLayout;
public class BuiltInDS implements EntryPoint {
private ListGrid lg;
private VLayout mainLayout;
private IButton recreateBtn;
public void onModuleLoad() {
KeyIdentifier debugKey = new KeyIdentifier();
debugKey.setCtrlKey(true);
debugKey.setKeyName("D");
Page.registerKey(debugKey, new PageKeyHandler() {
public void execute(String keyName) {
SC.showConsole();
}
});
mainLayout = new VLayout(20);
mainLayout.setWidth100();
mainLayout.setHeight100();
recreateBtn = new IButton("Recreate");
recreateBtn.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
recreate();
}
});
mainLayout.addMember(recreateBtn);
recreate();
mainLayout.draw();
}
private void recreate() {
Window w = new Window();
w.setWidth("95%");
w.setHeight("95%");
w.setMembersMargin(0);
w.setModalMaskOpacity(70);
w.setTitle("SelectItem Criteria operatorId");
w.setShowMinimizeButton(false);
w.setIsModal(true);
w.setShowModalMask(true);
w.centerInPage();
lg = new ListGrid(DataSource.get("employees"));
lg.setAutoFetchData(true);
lg.setShowFilterEditor(true);
ListGridField Name = new ListGridField("Name");
ListGridField EmployeeId = new ListGridField("EmployeeId");
ListGridField Job = new ListGridField("Job");
ListGridField Email = new ListGridField("Email");
ListGridField EmployeeType = new ListGridField("EmployeeType");
ListGridField Gender = new ListGridField("Gender");
ListGridField MaritalStatus = new ListGridField("MaritalStatus");
SelectItem props = new SelectItem();
props.setOperator(OperatorId.EQUALS);
Gender.setFilterEditorProperties(props);
lg.setFields(Name, EmployeeId, Job, Email, EmployeeType, Gender, MaritalStatus);
IButton sayCrits = new IButton("Show filterRow Criteria", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
SC.say("WITH PROPS", lg.getFilterEditorCriteria().asAdvancedCriteria().asString());
}
});
sayCrits.setWidth(250);
w.addItem(lg);
w.addItem(sayCrits);
w.show();
}
}[B][/B]
Trying with and without Gender.setFilterEditorProperties(props); will give you the result from the screenshot:
My expectation would be that as the generated item is a SelectItem and not a ComboBoxItem or TextItem, that the used operator is "equals" by default. This is not true, but could be seen as minor enhancement, only.
What I do not understand is that the operatorId used for "MaritalStatus" changes once I change the operatorId for "Gender".
This has no priority for me, I just noticed it while creating an other testcase.
Best regards
Blama
Comment