|
版本: |
其它(帖子中说明) |
小版本号: |
5569 |
|
|
数据库: |
MySQL |
服务器操作系统: |
Windows |
应用服务器: |
Tomcat |
客户端操作系统: |
Windows 其它 |
浏览器: |
Chrome |
|
|
一个自定义action,控制台报错:提示: 模块/upm/CRM/data中, 没有将概念visitingrecord映射到数据库
js代码: var listData = this.comp("listData");
var params = new biz.Request.ActionParam();
var IDs = new biz.Request.ListParam();
$.each(listData.getCheckeds(), function(i, row) {
debugger
IDs.add(row.getID());
});
params.setList("IDs", IDs);
biz.Request.sendBizRequest({
contentType : 'application/json',
dataType : "json",
"context" : this.getContext(),
"action" : "deleteVisitingRecordAction",
"parameters" : params,
"callback" : function(data) {
data.igonreError = false;
if (data.state) {
listData.refreshData();
}
}
}); |
action:
java代码:
public static JSONObject deleteVisitingRecord(List<String> IDs){
JSONObject json = new JSONObject();
json.put("state", "0");
System.out.println(IDs);
String items;
StringBuilder builder = new StringBuilder();
int len = IDs.size();
for(int i = 0; i<len;i++){
items = IDs.get(i);
if(builder.length() == 0){
builder.append(" v.fID in ('"+items+"'");
}else{
builder.append(",'"+items+"')");
}
// System.out.println(builder);
}
//修改表中数据
String ksql = "select a.* from visitingrecord a";
System.out.println(ksql);
try {
Table row = KSQL.select(ksql, null, "/upm/CRM/data", null);
System.out.println(row.toString());
json.clear();
json.put("state", "1");
} catch (Exception e) {
e.printStackTrace();
}
return json;
}
|
-
|