Class('App', 'linb.Com',{ Instance:{ iniComponents : function(){ // [[code created by jsLinb UI Builder var host=this, children=[], append=function(child){children.push(child.get(0))}; append( (new linb.DataBinder) .setHost(host,"databinder_json") .setDataSourceType("remoting") .setQueryURL("http://ajax.googleapis.com/ajax/services/search/web") .setQueryArgs({"v":"1.0", "q":"jsLinb"}) .setName("databinder_json") .afterRead("_databinder_1_afterread") ); append( (new linb.DataBinder) .setHost(host,"databinder_xmlrpc") .setDataSourceType("remoting") .setQueryURL("../../../backend/test/rpc/server.php") .setRequestType("XML") .setResponseType("XML") .setQueryArgs({"methodName":"passThrough", "params":[2790, 1290320.2323, null, "Hello world ☺", "Hello world2", new Date(2011,4,9,18,4,15,586), {"Color":"Red", "Truth":true}, [1, 2, 3, 4]]}) .setName("databinder_xmlrpc") .afterRead("_databinder_xmlrpc_afterread") ); append( (new linb.DataBinder) .setHost(host,"databinder_soap") .setDataSourceType("remoting") .setQueryURL("../../../backend/test/soap/soap.php") .setRequestType("SOAP") .setResponseType("SOAP") .setQueryArgs({"methodName":"getUserInfo", "params":{"bgin":"3", "limit":"323"}}) .setName("databinder_soap") .afterRead("_databinder_soap_afterread") ); append( (new linb.DataBinder) .setHost(host,"databinder_7") .setDataSourceType("remoting") .setQueryURL("http://127.0.0.1/gdzc/php/login.php") .setQueryMethod("POST") .setQueryArgs({"username":"李伟", "password":"cf79ae6addba60ad018347359bd144d2"}) .setName("databinder_7") .afterRead("_databinder_7_afterread") ); append( (new linb.UI.Group) .setHost(host,"ctl_group1") .setLeft(40) .setTop(40) .setWidth(650) .setHeight(80) .setCaption("DataBinder for <strong>google search API (JSON service)</strong>") .setToggleBtn(false) ); host.ctl_group1.append( (new linb.UI.SLabel) .setHost(host,"ctl_slabel3") .setLeft(30) .setTop(24) .setWidth(124) .setCaption("results count :") ); host.ctl_group1.append( (new linb.UI.SLabel) .setHost(host,"ctl_slabel4") .setLeft(310) .setTop(24) .setWidth(124) .setCaption("the top url is :") ); host.ctl_group1.append( (new linb.UI.Input) .setHost(host,"ctl_input1") .setDataBinder("databinder_json") .setDataField("returnurls") .setLeft(180) .setTop(20) .setLabelCaption("ctl_input1") ); host.ctl_group1.append( (new linb.UI.Input) .setHost(host,"ctl_input11") .setDataBinder("databinder_json") .setDataField("topurl") .setLeft(440) .setTop(20) .setLabelCaption("ctl_input1") ); append( (new linb.UI.Group) .setHost(host,"ctl_group15") .setLeft(40) .setTop(140) .setWidth(650) .setHeight(80) .setCaption("DataBinder for local <strong>XMLRPC service</strong>") .setToggleBtn(false) ); host.ctl_group15.append( (new linb.UI.SLabel) .setHost(host,"ctl_slabel33") .setLeft(30) .setTop(24) .setWidth(124) .setCaption("result 1 :") ); host.ctl_group15.append( (new linb.UI.SLabel) .setHost(host,"ctl_slabel34") .setLeft(310) .setTop(24) .setWidth(124) .setCaption("result 2 :") ); host.ctl_group15.append( (new linb.UI.Input) .setHost(host,"ctl_input20") .setDataBinder("databinder_xmlrpc") .setDataField("r1") .setLeft(180) .setTop(20) .setLabelCaption("ctl_input1") ); host.ctl_group15.append( (new linb.UI.Input) .setHost(host,"ctl_input21") .setDataBinder("databinder_xmlrpc") .setDataField("r2") .setLeft(440) .setTop(20) .setLabelCaption("ctl_input1") ); append( (new linb.UI.Group) .setHost(host,"ctl_group26") .setLeft(40) .setTop(240) .setWidth(650) .setHeight(80) .setCaption("DataBinder for local <strong>SOAP service</strong>") .setToggleBtn(false) ); host.ctl_group26.append( (new linb.UI.SLabel) .setHost(host,"ctl_slabel55") .setLeft(30) .setTop(24) .setWidth(124) .setCaption("user :") ); host.ctl_group26.append( (new linb.UI.SLabel) .setHost(host,"ctl_slabel56") .setLeft(310) .setTop(24) .setWidth(124) .setCaption("msg :") ); host.ctl_group26.append( (new linb.UI.Input) .setHost(host,"ctl_input42") .setDataBinder("databinder_soap") .setDataField("user") .setLeft(180) .setTop(20) .setLabelCaption("ctl_input1") ); host.ctl_group26.append( (new linb.UI.Input) .setHost(host,"ctl_input43") .setDataBinder("databinder_soap") .setDataField("msg") .setLeft(440) .setTop(20) .setLabelCaption("ctl_input1") ); append( (new linb.UI.Input) .setHost(host,"ctl_input40") .setDataBinder("databinder_7") .setDataField("success") .setLeft(220) .setTop(340) .setLabelCaption("ctl_input40") .setValue("true") ); append( (new linb.UI.Input) .setHost(host,"ctl_input41") .setDataBinder("databinder_7") .setDataField("deptname") .setLeft(500) .setTop(340) .setLabelCaption("ctl_input41") ); append( (new linb.UI.SButton) .setHost(host,"ctl_sbutton5") .setLeft(320) .setTop(410) .setWidth(130) .setCaption("ctl_sbutton5") .onClick("_ctl_sbutton5_onclick") ); return children; // ]]code created by jsLinb UI Builder }, _databinder_1_afterread : function (profile, rspData) { var rst=_.get(rspData,["responseData","results"]); return { returnurls:rst.length, topurl:rst[0].url }; }, _databinder_xmlrpc_afterread : function (profile, rspData) { return { r1: rspData.result[0], r2: rspData.result[3] }; }, _databinder_soap_afterread : function (profile, rspData) { return rspData.result; }, _databinder_7_afterread : function (profile,rspData){ var ns = this, uictrl = profile.boxing(); return { success:rspData.success,//返回的成功标志 deptname:rspData.info.deptname//返回的授权部门 } }, _ctl_sbutton5_onclick : function (profile,e,src,value){ var ns = this, uictrl = profile.boxing(); this.databinder_7.setQueryArgs({ "username" : "王强", "password" : "cf79ae6addba60ad018347359bd144d2" } ,true);//重设登录用户名及密码参数 this.databinder_7.read();//调用Read重新从服务器读数据 } } });