Friday, November 25, 2011

ADF Passing Parameter to Page - Execute with parameters

Requirement: Two page with different tables/viewobject one click on any record on first page next page should display values based on that parameter (execute with parameter)
1 - First Page to have list of records in table etc convert first column output text field to command link (link) item. If you see a warning on this field then in structure page remove and ConvertToNumber or other attribute which is not required with the field. This is coming from View1 object
2 - View2 is having query with bind variable say :parm1, now we need to pass value from view1 into parm1 of view2 object on click of that link.
3- Second page Drag and drop view2
4- In taskflow definition drag and drop the two pages. Now in DataControls expand View2 definition and in operations select ExecuteWithParameter and drag and drop it between the two pages in taskflow definition. It will ask for parameter value, In value dropdown select Expression ->ADF Managed Beans->pageFlowScope and type a parameter name like pid after #{pageFlowScope}i.e.#{pageFlowScope.pid}
5- Expand navigation control from from ExecuteWithParam operation to Page2 and from page1 to ExecuteWithOperation say the control link to be "select"
6-On first page select the link and action  attribute value select "select" from dropdown.
7-Now we need to pass value of this record to executewithparam opration. From operation panel select setPropertyListener and drop it on command link and set the values as From: #{row.DepartmentId} To:#{pageFlowScope.pid} Type: action