Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Two standalone DataSources won't fetch

    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");
    }
    });
    }
    }

    #2
    got the surprise when I upload the app to online server, that second fetch is called and returning the results.
    Files on dataURL are the same, has no mistake locally

    I'm testing my app on local lampp server with php 5, and online server is also apache php 5.

    What server's configurations may be afecting same compillation with differents behavior?

    thanks for yor replay!

    Comment

    Working...
    X