标签:
1 var response = justep.Request.sendBizRequest( 2 "/x5demo/misc/process/testKsql/testKsqlProcess","mainActivity", "testKsqlAction", param); 3 //判断请求是否执行成功 4 if(!justep.Request.isBizSuccess(response)){ 5 throw new Error("调用Action失败"); 6 }
1 justep.Request.sendBizRequest2({ 2 dataType: "json", 3 action: "testKsqlAction", 4 parameters : param, 5 callback: function(result) { 6 if (result.state) { 7 alert("调用成功!"); 8 } else { 9 throw new Error("调用失败!|" + result.response.message); 10 } 11 } 12 });
创建一个参数对象,添加参数。不同类型的参数使用不同的set方法
var actionParam = new justep.Request.ActionParam();
简单类型
1 actionParam.setString("stringParam", "传个字符串回去"); 2 3 actionParam.setDate("dateParam", now); 4 actionParam.setTime(‘para_time‘, "12:55:55"); 5 actionParam.setDateTime("datetimeParam", now);//日期时间类型对应到java中的Timestamp类型 6 7 actionParam.setInteger("integerParam", 9876); 8 actionParam.setFloat(‘para_float‘, 1.345); 9 10 actionParam.setBoolean("booleanParam", true);
list类型
1 var listParam = new justep.Request.ListParam(); 2 listParam.add(new justep.Request.SimpleParam("列表项1",justep.XML.Namespaces.XMLSCHEMA_STRING)); 3 listParam.add(new justep.Request.SimpleParam("45678",justep.XML.Namespaces.XMLSCHEMA_INTEGER)); 4 actionParam.setList("listParam", listParam);
map类型
1 var mapParam = new justep.Request.MapParam(); 2 mapParam.put("key1", new justep.Request.SimpleParam("Map项1",justep.XML.Namespaces.XMLSCHEMA_STRING)); 3 mapParam.put("key2", new justep.Request.SimpleParam("Map项2",justep.XML.Namespaces.XMLSCHEMA_STRING)); 4 mapParam.put("key3", new justep.Request.SimpleParam("Map项3",justep.XML.Namespaces.XMLSCHEMA_STRING)); 5 actionParam.setMap("mapParam", mapParam);
table类型
1 var dRole = justep.xbl("dRole"); 2 actionParam.setTable("tableParam", new justep.Request.TableParam(dRole.Serialize(false, false)));
详细内容见:http://wex5.com/cn/bbs/thread-33841-1-1.html
标签:
原文地址:http://www.cnblogs.com/kingxiaozi/p/4341428.html