Hi. I'm sure I'm missing something obvious, but I can't figure out what. When I add criteria to a grid (whether via ListGrid.getCriteria() or ListGrid.getFilterEditorCriteria()), I always get NULL when I subsequently call the corresponding getCriteria method.
I have:
And, of course, my ds.xml has the following line in it:
I have:
Code:
public class SmartGWTTestCase implements EntryPoint { public void onModuleLoad() { if (!GWT.isScript()) { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("D"); Page.registerKey(debugKey, new KeyCallback() { public void execute(String keyName) { SC.showConsole(); } }); } RPCManager.setPromptStyle(PromptStyle.CURSOR); DataSource dataSource = DataSource.get("myds"); final ListGrid listGrid = new ListGrid(); listGrid.setWidth100(); listGrid.setHeight100(); // listGrid.setAutoFetchData(true); listGrid.setDataSource(dataSource); listGrid.setShowFilterEditor(true); listGrid.setUseAllDataSourceFields(true); ListGridField reportDateField = new ListGridField("reportDate"); reportDateField.setFilterEditorType(new DateRangeItem(listGrid, "Report")); listGrid.setFields(reportDateField); listGrid.draw(); com.smartgwt.client.data.Criteria c = new com.smartgwt.client.data.Criteria(); c.addCriteria("startReportDate", new java.util.Date(0)); listGrid.setCriteria(c); SC.say(listGrid.getCriteria() == null ? "null" : "Not null"); } }
Code:
<field name="startReportDate" type="date" hidden="true" customSQL="true"></field>
Comment