Hello smartgwt team, I need various datasources in one class to manually catch results and fill with them some values. My first attempt was reusing datasource and just change criteria, but second fetch never happens, so I made a new datasource to finally get my results but failed again.
How can I make more than one call to server?
Thanks for your help!
public class Test implements EntryPoint {
public void onModuleLoad() {
DataSource ds = new DataSource();
ds.setDataFormat(DSDataFormat.JSON);
ds.setDataURL("data/udidatos.php");
Criteria c = new Criteria();
c.addCriteria("idudi", 1);
c.addCriteria("paso", "1");
ds.fetchData(c,new DSCallback() {
@Override
public void execute(DSResponse response, Object rawData,
DSRequest request) {
SC.say("first fetch");
}
});
DataSource ds2 = new DataSource();
ds2.setDataFormat(DSDataFormat.JSON);
ds2.setDataURL("data/udibiblio.php");
ds2.fetchData(null, new DSCallback(){
@Override
public void execute(DSResponse response, Object rawData,
DSRequest request) {
SC.say("second fetch");
}
});
}
}
How can I make more than one call to server?
Thanks for your help!
public class Test implements EntryPoint {
public void onModuleLoad() {
DataSource ds = new DataSource();
ds.setDataFormat(DSDataFormat.JSON);
ds.setDataURL("data/udidatos.php");
Criteria c = new Criteria();
c.addCriteria("idudi", 1);
c.addCriteria("paso", "1");
ds.fetchData(c,new DSCallback() {
@Override
public void execute(DSResponse response, Object rawData,
DSRequest request) {
SC.say("first fetch");
}
});
DataSource ds2 = new DataSource();
ds2.setDataFormat(DSDataFormat.JSON);
ds2.setDataURL("data/udibiblio.php");
ds2.fetchData(null, new DSCallback(){
@Override
public void execute(DSResponse response, Object rawData,
DSRequest request) {
SC.say("second fetch");
}
});
}
}
Comment