|
我是这样做的,在流程下新建一个W页面,然后放了一个button,再放一个windowruner,然后建立一个DataTask,并设置属性concept为SA_Task,增加过滤条件(SA_Task.sKindID='tkTask' or SA_Task.sKindID='tkExecutor' or SA_Task.sKindID IS NULL)
and (SA_Task.sStatusID='tesReady' or SA_Task.sStatusID='tesExecuting')
and (SA_Task.sTypeID IS NULL or SA_Task.sTypeID <> 'WORKREMIND')
and SA_Task.sExecutorPersonID=:currentPersonID()然后在master中设置data为maindata,在column设置为sData1,然后在该页面的process设置Java文件为public static Table taskData(String sData1){
String ksql="Select task,task.sEURL,task.sActivityName from SA_Task task where task.sData1 = '"+sData1+"' and (task.sKindID='tkTask' or task.sKindID='tkExecutor' or task.sKindID IS NULL) " +
"and (task.sStatusID='tesReady' or task.sStatusID='tesExecuting') " +
"and (task.sTypeID IS NULL or task.sTypeID <> 'WORKREMIND')" +
"and task.sExecutorPersonID=:currentPersonID()";
Table table = KSQL.select(ksql, null, "/system/data", null);
return table;
}然后在button的onclick中输入代码var dList = this.comp("mainData");
var sData1 = dList.getCurrentRowID();
//定义action参数,请求taskDataAction获取当前环节的数据信息
var param = new biz.Request.ActionParam();
var taskRows = "";
param.setString("sData1", sData1);
biz.Request.sendBizRequest({
"context" : this.getContext(),
"action" : "taskDataAction",
"parameters" : param,
"callback" : function(callbackData) {
if (callbackData.state) {
taskRows = callbackData.response.rows;
} else
alert("任务数据获取失败");
}
});
//当有数据返回时获取第一条的信息进行处理
if (taskRows.length > 0) {
var title = taskRows[0].sActivityName.value;//获得当前环节名称,作为页面的标题
var taskID = taskRows[0].task.value;//获得任务ID,url中的参数
var url = taskRows[0].sEURL.value;//获得当前环节的url
url = url + "?task=" + taskID + "&_pagePattern=write";//_pagePattern=write是必须的,表示要处理这个任务
justep.Shell.showPage({
url : url,
title : title
}); //调用justep.Shell.showPage方法打开流程当前环节对应的w文件
} else {
alert("流转未启动、已完成、或者应由其他人处理");
}然后在页面浏览时,点button时出现加载undefined出错,请大神指点 |
|