|
版本: |
|
小版本号: |
|
|
|
数据库: |
|
服务器操作系统: |
|
应用服务器: |
|
客户端操作系统: |
|
浏览器: |
|
|
|
自定义Action Java代码
public static Table querylvl3Relation(){
StringBuffer buffer = new StringBuffer(1000);
buffer.append("select * ") /* select 处省略*/
.append(" from YC_GOALRELATION YC_GOALRELATION ")/*YC_GOALRELATION做主表*/
.append(" optional join YC_THIRDLEVELGOAL YC_THIRDLEVELGOAL on YC_GOALRELATION.fg_goalId = YC_THIRDLEVELGOAL")
.append(" optional join YC_SECONDLEVELGOAL YC_SECONDLEVELGOAL on YC_THIRDLEVELGOAL.ft_secondLevelGoal = YC_SECONDLEVELGOAL")
.append(" optional join SA_OPOrg SA_OPOrg on YC_GOALRELATION.fg_relationId = SA_OPOrg")
.append(" where YC_GOALRELATION.fg_relationType = '1'")
.append(" order by YC_THIRDLEVELGOAL.ft_goalDecisionTime desc");
Table table = null;
try{
table = KSQL.select(buffer.toString(), null, "/wlmyqc/goalManage/data", null);
table.getProperties().put(Table.PROP_NAME_ROWID, "YC_GOALRELATION");/*用 YC_GOALRELATION 作为ROWID*/
table.getProperties().put(Table.PROP_DB_COUNT, 100);
}catch(Exception e){
e.printStackTrace();
}
return table;
}
自定义的Action 为多表关联的KSQL,并且以YC_GOALRELATION作为ROWID。
js部分:
mainActivity.model1Load = function(event){
justep.Request.sendBizRequest2({
dataType: "json",
action: "querylvl3Relation",
callback: function(result) {
if (result.state) {
justep.xbl("bizData1").loadJson(result.response);
} else {
throw new Error("调用失败!|" + result.response.message);
}
}
});
};
这部分是在model的onload方法中把自定义Action的数据绑定到bizData1上。并且列表是可以展示数据的。
但是,问题就出在列表删除上,代码如下:
mainActivity.delTriggerClick = function(event){
var data = justep.xbl('bizData1');
var deleteConfirm = data.deleteConfirm;
var directDeleteMode = data.directDeleteMode;
try{
data.deleteConfirm = true;
data.directDeleteMode = true;
data.deleteData(data.getID());
}finally{
data.deleteConfirm = deleteConfirm;
data.directDeleteMode = directDeleteMode;
}
};
页面点击“删除”按钮,报错:
Unexpected token }
SyntaxError: Unexpected token }
at Object.parse (native)
at new justep.(anonymous function) (http://10.238.240.25:8080/x5/$vb3dd0af009f34fc7b930757c6b8af5c3/base/base.js?language=zh_CN:1:179093)
at Object.createBizParam2 (http://10.238.240.25:8080/x5/$vb3dd0af009f34fc7b930757c6b8af5c3/base/base.js?language=zh_CN:1:56215)
at Object.sendBizRequest2 (http://10.238.240.25:8080/x5/$vb3dd0af009f34fc7b930757c6b8af5c3/base/base.js?language=zh_CN:1:35203)
at null.doDirectDeleteData (http://10.238.240.25:8080/x5/$vca33db8a172e4e5193f5fe6a5dc566b4/component/data/data.js?language=zh_CN:1:43910)
at null.deleteData (http://10.238.240.25:8080/x5/$vca33db8a172e4e5193f5fe6a5dc566b4/component/data/data.js?language=zh_CN:1:49771)
at Object.mainActivity.delTriggerClick (http://10.238.240.25:8080/x5/$v08177fb33cb840ab8e0eee90a76b1012/UI/wlmyqc/goalManage/process/thirdLevelGoal/mainActivity.js?language=zh_CN:33:8)
at null.callFunction (http://10.238.240.25:8080/x5/$v6df20d15250b4f728f185de10f524473/UI/wlmyqc/goalManage/process/thirdLevelGoal/.cache/mainActivity_zh_CN_x5_51a653e356414dab9108818b4fc854a8.js?language=zh_CN&$version=ebee3670-a168-4db8-bfa7-8e71f87d1fe2:532:119)
at null.run (http://10.238.240.25:8080/x5/$v8f6e720f9a034338be2baa62c388f26d/form/form.js?language=zh_CN:1:386415)
at null.exec_ (http://10.238.240.25:8080/x5/$v8f6e720f9a034338be2baa62c388f26d/form/form.js?language=zh_CN:1:308283)
|
|