Package org.sgx.yuigwt.yui.datasource

Examples of org.sgx.yuigwt.yui.datasource.DataSource


  public void ready(final YuiContext Y) { 
    final Console console1 = Y.newConsole(ConsoleConfig.create().collapsed(true)).render().cast();
   
    //test 1 : Using DataSource.Local
    JavaScriptObject data1 = data1();
    DataSource ds1 = Y.newDataSourceLocal(DataSourceConfig.create().source(data1));
    ds1.sendRequest(DataSourceRequest.create().callback(new DataSourceCallbackAdapter() {
      @Override
      public void success(DataSourceEvent e) {
        console1.log("success1: "+JsUtil.dumpObj(e.response().meta())+
          " - "+JsUtil.dumpObj(e.response().results(), true));
      }
      @Override
      public void failure(DataSourceEvent e) {
        Window.alert("failure1: "+JsUtil.dumpObj(e));
      }
    }));
   
    //test2: use DataSource.Get for getting data from datatables.org:
    String ds2url =  "http://query.yahooapis.com/v1/public/yql?format=json&",
      yqlQuery = "show tables";
    DataSource ds2 = Y.newDataSourceGet(DataSourceConfig.create().source(ds2url));
    ds2.sendRequest(DataSourceRequest.create()
      .request("q="+yqlQuery)
      .callback(new DataSourceCallbackAdapter() {
      @Override
      public void success(DataSourceEvent e) {
//        JsArray<Result> results = e.response().results().cast();
View Full Code Here


  public void ready(final YuiContext Y) { 
    final Console console1 = Y.newConsole(ConsoleConfig.create().collapsed(true)).render().cast();
   
    //test 1 : Using DataSource.Local
    JavaScriptObject data1 = data1();
    DataSource ds1 = Y.newDataSourceLocal(DataSourceConfig.create().source(data1));    
   
    ds1.sendRequest(DataSourceRequest.create().callback(new DataSourceCallbackAdapter() {
      @Override
      public void success(DataSourceEvent e) {
        console1.log("success1: "+JsUtil.dumpObj(e.response().meta())+
          " - "+JsUtil.dumpObj(e.response().results(), true));
      }
      @Override
      public void failure(DataSourceEvent e) {
        Window.alert("failure1: "+JsUtil.dumpObj(e));
      }
    }));
   
    //test2: use DataSource.Get for getting data from datatables.org:
    String ds2url =  "http://query.yahooapis.com/v1/public/yql?format=json&",
      yqlQuery = "show tables";
    DataSource ds2 = Y.newDataSourceGet(DataSourceConfig.create().source(ds2url));
    ds2.sendRequest(DataSourceRequest.create()
      .request("q="+yqlQuery)
      .callback(new DataSourceCallbackAdapter() {
      @Override
      public void success(DataSourceEvent e) {
//        JsArray<Result> results = e.response().results().cast();
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yui.datasource.DataSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.