When using the filtereditor, the listgrid looses its criteria set with setCriteria().
(I heard that since 2.3, the programmatically set criteria were always applied and sticky, independently from the filtereditor criteria)
This is my datasource definition:
This is my testcase:
This will result in the following request upon startup:
When I fill in something in the filtereditor, it results in the following request (original criteria have disappeared)
Am I doing something wrong?
(I was expecting that the user filter on cstm_description would be combined with the program filter on cstm_pk)
(I also don't understand why the second request uses AdvancedCriteria, it seems possible with simple criteria?)
(I heard that since 2.3, the programmatically set criteria were always applied and sticky, independently from the filtereditor criteria)
This is my datasource definition:
Code:
<DataSource serverType="sql" dbName="Mysql" tableName="Customer" ID="Customer" > <fields> <field primaryKey="true" type="sequence" name="cstm_pk" hidden="true"></field> <field type="integer" length="10" name="cstm_number" title="" required="true" export="true"></field> <field type="text" length="45" name="cstm_name" title="" required="true" export="true"></field> <field type="text" length="4000" name="cstm_description" title="" export="true"></field> </fields> </DataSource>
Code:
public class CustomerGridTest implements EntryPoint { public void onModuleLoad() { VLayout layout = new VLayout(); layout.setHeight100(); layout.setWidth100(); ListGrid grid = new ListGrid(); grid.setDataSource(DataSource.get("Customer")); grid.setShowFilterEditor(true); grid.setFilterOnKeypress(true); layout.addMember(grid); Criteria crit = new Criteria(); crit.addCriteria("cstm_pk", 1); grid.setCriteria(crit); grid.fetchData(crit); layout.draw(); } }
Code:
criteria:{ cstm_pk:1 }, operationConfig:{ dataSource:"Customer", operationType:"fetch", textMatchStyle:"exact" }, startRow:0, endRow:75, componentId:"isc_ListGrid_0", appID:"builtinApplication", operation:"Customer_fetch", oldValues:{ cstm_pk:1 }
Code:
criteria:{ _constructor:"AdvancedCriteria", operator:"and", criteria:[ { fieldName:"cstm_description", operator:"iContains", value:"n" } ] }, operationConfig:{ dataSource:"Customer", operationType:"fetch", textMatchStyle:"substring" }, startRow:0, endRow:75, componentId:"isc_ListGrid_0", appID:"builtinApplication", operation:"Customer_fetch", oldValues:{ _constructor:"AdvancedCriteria", operator:"and", criteria:[ { fieldName:"cstm_description", operator:"iContains", value:"n" } ] } }
(I was expecting that the user filter on cstm_description would be combined with the program filter on cstm_pk)
(I also don't understand why the second request uses AdvancedCriteria, it seems possible with simple criteria?)
Comment