Dear Sir,
We have a number of search and input combo box controls sharing the same DataSource object currently in our pages, e.g. Sub-fund selection combo box, and they are implemented in below way:
— Code in class PageA —
— Code in class PageB —
Now the problem is SmartGWT manages only one singleton object per data source ID, the method DataSource.getDataSource("subfund") will return the same singleton instance in all pages. This creates the conflict like, for example:
Page A is applying sort field "subfundMnemonic' on the combo box, and Page B is not applying any sorting.
But you will still see a sorted result in Page B's combo box if you have entered Page A before.
Which means the DataSource filtering, sorting criteria will be corrupted by each other.
There will be serious impact of redundancy if we declare individual data source for every combo box on each page, so we suppose this is the last approach we would like to take.
We have also tried some method in DataSource class like .setCacheAllData(boolean cacheAllData), however they are not helping on the issue.
It is highly appreciated if you could provide any way to get the 'prototype' instance of DataSource. Thanks very much
We have a number of search and input combo box controls sharing the same DataSource object currently in our pages, e.g. Sub-fund selection combo box, and they are implemented in below way:
— Code in class PageA —
Code:
private DataSource dsSubfund = DataSource.getDataSource("subfund"); private StandardComboBoxItem cbSubfund = new StandardComboBoxItem("subfundCode1", "Subfund1"); cbSubfund.setOptionDataSource(dsSubfund); cbSubfund.setSortField("subfundMnemonic");
Code:
private DataSource dsSubfund = DataSource.getDataSource("subfund"); private StandardComboBoxItem cbSubfund = new StandardComboBoxItem("subfundCode2", "Subfund2"); cbSubfund.setOptionDataSource(dsSubfund);
Now the problem is SmartGWT manages only one singleton object per data source ID, the method DataSource.getDataSource("subfund") will return the same singleton instance in all pages. This creates the conflict like, for example:
Page A is applying sort field "subfundMnemonic' on the combo box, and Page B is not applying any sorting.
But you will still see a sorted result in Page B's combo box if you have entered Page A before.
Which means the DataSource filtering, sorting criteria will be corrupted by each other.
There will be serious impact of redundancy if we declare individual data source for every combo box on each page, so we suppose this is the last approach we would like to take.
We have also tried some method in DataSource class like .setCacheAllData(boolean cacheAllData), however they are not helping on the issue.
It is highly appreciated if you could provide any way to get the 'prototype' instance of DataSource. Thanks very much
Comment