I like the functionality of setDisplayField very, is seems to do some odd things with the search field.
If a listGridField has a setDisplayField set, after a search by manipulating the search field and pressing enter, the datasource of the listGrid is 3(!) times fetched. Why is that? only the last fetch has a filled startRow and endRow in the XML request to the RestDataSource.
The first 2 requests look like this:
<request>
<data>
<isc_OID_126>
<division>searchme</division>
</isc_OID_126>
</data>
<dataSource>isc_OID_126</dataSource>
<operationType>fetch</operationType>
<operationId>1231711514926</operationId>
<startRow/>
<endRow/>
<sortBy/>
<textMatchStyle/>
<oldValues/>
</request>
<request>
<data>
<isc_OID_126>
<division>searchme</division>
</isc_OID_126>
</data>
<dataSource>isc_OID_126</dataSource>
<operationType>fetch</operationType>
<operationId>1231711515248</operationId>
<startRow/>
<endRow/>
<sortBy/>
<textMatchStyle/>
<oldValues/>
</request>
last request:
<request>
<data>
<isc_OID_126>
<division___toString>searchme</division___toString>
<division>searchme</division>
</isc_OID_126>
</data>
<dataSource>isc_OID_126</dataSource>
<operationType>fetch</operationType>
<operationId>1231711515261</operationId>
<startRow>0</startRow>
<endRow>50</endRow>
<sortBy/>
<textMatchStyle>substring</textMatchStyle>
<componentId>isc_OID_118</componentId>
<oldValues/>
</request>
I assume that this last request comes from the listGrid wanting new filtered data. The other request are (I assume) from the searchField?, maybe it wants to “resolve” the value typed in towards the DisplayField, which is configured for this listGridField. I even use the excellent:
listGridField.setFilterEditorType(new TextItem());
in order to keep the filterField dumb, but no results. (another thing is that it seems that this resolving is done unrestricted! (empty startRow, endRow, see the first 2 requests) which is always wrong IMHO, my datasets are way to large for unrestricted queries)
I all seems that the search field is pretty(/too) smart IMHO (it also gets prefilled with default values f the listgrid field, which I don’t want)
Here are my questions:
-
Can u explain the multiple request towards the RestDataSource? (this only happens then I set a displayField on the ListGridField)
-
Can the filter field be made so that it is just a parameter in the request to the datasource. i.e. not a smart field which tries to resolve it’s contents in the case of a set displayField? (I think it should always be manipulated by the user, never by smartgwt)
-
Can I disable the defaultValue which is set in the filterField when the listGridField has a default value? I do like the defaultValue when a new record is made.