Monday, September 2, 2013

Passing Parameter to ADF view activities

Parameters can be passed to a view activity in task flow.Create a bounded task flow as below
Look at the page parameters section on properties of viewParam_view2.jsff.Each parameter has a from value and to value.
Code for viewParam_view1.jsff :
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
          xmlns:f="http://java.sun.com/jsf/core">
  <af:panelGroupLayout id="pgl1">
    <af:button text="button 1" id="b1" action="toParam2">
      <f:setPropertyActionListener target="#{pageFlowScope.empID}" value="2345"/>
    </af:button>
  </af:panelGroupLayout>

</jsp:root>

empId is set from this page using an property listener action listener.

Code for viewParam_view2.jsff 
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
  <af:panelGroupLayout id="pgl1">
    <af:outputText value="Test=#{pageFlowScope.empNo}" id="ot1"/>
  </af:panelGroupLayout>
</jsp:root>
Drag and drop the task flow as a region in a page and run the page.Click on the button to set the property and that can be viewed in the view2.



No comments:

Post a Comment