« A Time/Hour Selector in ADF Faces - Did you know? | Main | ADF Query with Parameters and List of Values »

Passing Value Between Pages to Filter a View Object

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)

Boris:

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

shay:

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

Myung:

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.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on November 24, 2009 9:42 AM.

The previous post in this blog was A Time/Hour Selector in ADF Faces - Did you know?.

The next post in this blog is ADF Query with Parameters and List of Values.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle