Task Flow使用指南之四:获取Task Flow返回值(1)

187 篇文章 2 订阅
开发环境:JDevloper 11.1.2.2.0+ Oracle Database 10g Express Edition 10.2.0.1。

本实验在《 Task Flow使用指南之三:以Dialog方式显示Task Flow 》基础之上,获取Task Flow返回值。

1. 选中TaskFlow Call Activity,设置Return参数


2. 双击TaskFlow Call Activity,打开TaskFlow定义,在空白点击一下,设置Return参数



3. 修改departmentList页面中调用TaskFlow的按钮代码,增加returnListener 
(1)页面代码
<af:commandButton text="To Employees" id="cb1" action="toEmployees" useWindow="true"
                  windowEmbedStyle="inlineDocument" windowWidth="600" windowHeight="320"
                  returnListener="#{myBackingBean.employeesTaskFlow2ReturnListener}">
    <af:setPropertyListener from="#{bindings.DepartmentId}" to="#{pageFlowScope.deptId}" type="action"/>
</af:commandButton>

(2)Managed Bean代码
    public void employeesTaskFlow2ReturnListener(ReturnEvent returnEvent) {
        System.out.println("$$$$$$$$$$$$$$$$$ return Value: " + returnEvent.getReturnValue());
        Map params = returnEvent.getReturnParameters();
        //System.out.println("$$$$$$$$$$$$$$$$$ return Value: empId " + params.get("empId"));
        for (Map.Entry entry : params.entrySet()) {
            Object key = entry.getKey();
            Object value = entry.getValue();
            System.out.println("$$$$$$$$$$$$$$$$$ return Values: " + key.toString() + " : " + value.toString());
        }
    }


4. 修改employeeList页面中返回按钮的代码,增加setPropertyListener
<af:commandButton text="to Return" id="cb1" action="toReturn">
  <af:setPropertyListener from="#{bindings.EmployeeId.inputValue}" to="#{pageFlowScope.empId}" type="action"/>
</af:commandButton>


5. 运行

Console日志中会输出:
$$$$$$$$$$$$$$$$$ return Value: null
$$$$$$$$$$$$$$$$$ return Values: empId : 136

Project 下载:ADF_TaskFlow_PageToTaskFlow(InlinePopupReturnValue).7z

http://maping930883.blogspot.com/2010/04/adf085task-flowtask-flow1.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值