I have some lists grid showing "pre-filtered data views" based on a particular field value. When some data changes arrive (triggered by events external from SC datasources), I use DataSource.updateCaches with update operation type to integrate them.
The problem is that when the changes would "move" a record from a list grid to another (since the "discriminator field" value has changed) the record doesn't appear in the grid where the filter should match.
Could you please give it a look?
The grids loads all data, hence filtering them at client side...
I've attached a complete example, however the relevant bits are:
where the grids are created using
From developer console I see
and that allMatchingRowsCached true doesn't sound so good...
Using SmartClient Version: SC_SNAPSHOT-2010-12-31/LGPL Development Only (built 2010-12-31)
The problem is that when the changes would "move" a record from a list grid to another (since the "discriminator field" value has changed) the record doesn't appear in the grid where the filter should match.
Could you please give it a look?
The grids loads all data, hence filtering them at client side...
I've attached a complete example, however the relevant bits are:
Code:
private void simulateCustomServerRountripAndUpdate (final Record record) { final DSRequest dsRequest = new DSRequest (); dsRequest.setOperationType (DSOperationType.UPDATE); dsRequest.setDataSource (mainDataSource.getID ()); final DSResponse dsResponse = new DSResponse (); dsResponse.setData (new Record[]{record}); mainDataSource.updateCaches (dsResponse, dsRequest); }
Code:
final ListGrid listGrid = new ListGrid (); listGrid.setDataFetchMode (FetchMode.LOCAL); listGrid.setAutoFetchData (true); listGrid.setDataSource (getMainDataSource ()); listGrid.setShowFilterEditor (true); listGrid.setHeight (130); listGrid.setSelectionType (SelectionStyle.SINGLE); if (optionFilter != null) { listGrid.setInitialCriteria (new Criteria ("option_id", optionFilter.toString ())); } final ListGridField idField = new ListGridField ("id"); final ListGridField nameField = new ListGridField ("name"); final ListGridField optionField = new ListGridField ("option_id"); optionField.setOptionDataSource (getOptionDataSource ()); optionField.setValueField ("id"); optionField.setDisplayField ("name");
12:14:48.829:MUP0:INFO:ResultSet:isc_ResultSet_0 (created by: isc_ListGrid_0):updating cache in place after operationType: update, allMatchingRowsCached true
12:14:48.829:MUP0:INFO:ResultSet:isc_ResultSet_0 (created by: isc_ListGrid_0):Updating cache: operationType 'update' (no componentID) ,1 rows update data
12:14:48.829:MUP0:INFO:ResultSet:isc_ResultSet_0 (created by: isc_ListGrid_0):Updating cache: operationType 'update' (no componentID) ,1 rows update data
Using SmartClient Version: SC_SNAPSHOT-2010-12-31/LGPL Development Only (built 2010-12-31)
Comment