Package org.sgx.yuigwt.yui.dataschema

Examples of org.sgx.yuigwt.yui.dataschema.DataSchemaResult


    Schema schema = Schema.create().resultListLocator("tr").resultFields(new Field[]{
      Field.create().key("beverage").locator("td[1]"),
      Field.create().key("price").locator("td[2]")
    });
   
    DataSchemaResult ret = Y.DataSchemaXML().apply(schema, table.getDOMNode());
   
    if(ret.error()!=null)
      throw new JavaScriptException(ret.error());
    Window.alert(Y.dump(ret));
     
  }
});
}
View Full Code Here


      JsObject.one("make", "Ford")._("model", "Mustang")._("year", 1968)
    );
    Schema schema = Schema.create().resultFields(new Field[]{
      Field.create().key("model"), Field.create().key("year")
    });
    DataSchemaResult data_out = Y.DataSchemaArray().apply(schema, data_in);
    Window.alert(Y.dump(data_out.results())); //data_out.results().length()+" - "+JsUtil.dumpObj(data_out, true));
   
   
    //another little test, this time reading a json string contained mixed formed data
    String data_in2  = "[\n"+
    "            {make:\"Chevrolet\",model:\"Bel Air\",year:1957},\n"+
    "            [\"Dodge\", \"Dart\", 1964],\n"+
    "            \"1968 Ford Mustang\"\n"+
    "]";
   
    Schema schema2 = Schema.create().resultFields(new Field[]{
        Field.create().key("make"), Field.create().key("model"), Field.create().key("year")
    });
    DataSchemaResult data_out2 = Y.DataSchemaArray().apply(schema2, JsonUtils.unsafeEval(data_in2));
    Window.alert(Y.dump(data_out2.results()));
  }
});
}
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yui.dataschema.DataSchemaResult

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.