A frequent question we get from beginners is how to I choose a value on one page and pass it to another page to show a specific record or set of records.
In previous blog posts I showed how easy it is to do this when you are using the same view object on both pages - using the setCurrentRowWithKey operation, and In another entry I showed how to use an execute with params before a page loads to filter the data in that page.
But on OTN someone asked how do you do this when you use two different views on the two pages. This would be a combination of both techniques - but using a parameter passing instead of setCurrentRow operation.
So here is a little video showing the basic technique.
We are going to use a pageFlowScope variable to pass the value from one page to the filtering method (executeWithParam) and then to the second page.
Comments (3)
Hi Shay!
This post was very useful of me. But I have a little bit more complex requirements.
VO deptByParam should have WHERE clause something like "WHERE :p_id IS NOT NULL AND department_id = :p_id". So it means that if p_id is null then show me all data.
Next thing I need to do is passing url parameter for this p_id parameter.
Thx
Regards,
Boris
Posted by Boris | December 3, 2009 1:08 AM
Posted on December 3, 2009 01:08
Boris,
Try to change your where clause to
Where nvl(:p_id,department_id)=department_id
You can pick URL parameters by accessing the request object in your expression language.
Shay
Posted by shay | December 3, 2009 12:06 PM
Posted on December 3, 2009 12:06
Hi Shay... :)
This post is great.. I have help from it.
However, I'm wondering something...
i tried passing two values..it did not work.
how to declare property of set action listener?
is it impossible? please, help me.
Posted by Myung | January 28, 2010 12:44 AM
Posted on January 28, 2010 00:44