Is it normal for Is there a way to configure the datasource so the fetch operation is only called once?
//Client code
public class DatasourceTester {
public static void doLocalTest(){
final ListGrid listGrid = new ListGrid();
DataSource datasource = DataSource.get("testDS");
datasource.getClientOnlyDataSource(new Criteria(), new ClientOnlyDataSourceCallback() {
@Override
public void execute(DataSource localDataSource) {
listGrid.setDataSource(localDataSource);
}
});
}
}
//Server side fetch - being called twice
public DSResponse fetch(DSRequest request){
DSResponse response = new DSResponse();
List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
response.setData(results);
return response;
}
//DS config
<DataSource ID="testDS" serverType="generic">
<serverObject className="com.dotomi.zisa.beans.TestBean" methodName="fetch"/>
<fields>
<field name="test_field" type="text" hidden="false" required="true"/>
</fields>
</DataSource>
//Client code
public class DatasourceTester {
public static void doLocalTest(){
final ListGrid listGrid = new ListGrid();
DataSource datasource = DataSource.get("testDS");
datasource.getClientOnlyDataSource(new Criteria(), new ClientOnlyDataSourceCallback() {
@Override
public void execute(DataSource localDataSource) {
listGrid.setDataSource(localDataSource);
}
});
}
}
//Server side fetch - being called twice
public DSResponse fetch(DSRequest request){
DSResponse response = new DSResponse();
List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
response.setData(results);
return response;
}
//DS config
<DataSource ID="testDS" serverType="generic">
<serverObject className="com.dotomi.zisa.beans.TestBean" methodName="fetch"/>
<fields>
<field name="test_field" type="text" hidden="false" required="true"/>
</fields>
</DataSource>
Comment