Hi there,
I'm pretty new to SmartGWT so please apologise for the basic question.
I want to populate a ListGrid from two data sources. Both data sources return "compatible" records, i.e. records with the same fields structure (same number of fields, same field names and same field types). So basically I want to merge the two sets of records coming from the two data sources in order to populate the list grid.
I have tried doing so by using a third, client-only, data source whose purpose is only to act as a layer between the two original data sources and the grid.
For a start, and as a simplified example, I just used one original data source (originalDs) to test the layer design (layerDs) and I can't manage to display the data into the grid.
However I can see that the data is actually fetched, indeed, I can see the typical server action window poping up, I have also checked that the data passed to layerDs.setTestData(response.getData()) is accurate, and still, eventually the grid doesn't display anything.
If I change grid.setDataSource(layerDs) into grid.setDataSource(originalDs) everything works fine...
Any suggestions either on the example above or on a better way to achieve some data source merging would be greatly appreciated.
As I said these are my first steps into the framework, I understand that I might have gone the wrong direction by overloading DSCallback.execute(), please then point me to the right direction.
Thank you,
- Luc
I'm pretty new to SmartGWT so please apologise for the basic question.
I want to populate a ListGrid from two data sources. Both data sources return "compatible" records, i.e. records with the same fields structure (same number of fields, same field names and same field types). So basically I want to merge the two sets of records coming from the two data sources in order to populate the list grid.
I have tried doing so by using a third, client-only, data source whose purpose is only to act as a layer between the two original data sources and the grid.
For a start, and as a simplified example, I just used one original data source (originalDs) to test the layer design (layerDs) and I can't manage to display the data into the grid.
Code:
ListGrid grid = new ListGrid(); grid.SetAuto DataSource originalDs = new DataSource(); //... //setting up originalDs here //... final DataSource layerDs = new DataSource(); layerDs.setClientOnly(true); originalDs.fetchData(null, new DSCallback() { public void execute(DSResponse response, Object rawData, DSRequest request) { layerDs.setTestData(response.getData()); return; } }); grid.setDataSource(layerDs); grid.fetchData();
If I change grid.setDataSource(layerDs) into grid.setDataSource(originalDs) everything works fine...
Any suggestions either on the example above or on a better way to achieve some data source merging would be greatly appreciated.
As I said these are my first steps into the framework, I understand that I might have gone the wrong direction by overloading DSCallback.execute(), please then point me to the right direction.
Thank you,
- Luc
Comment