Friday 24 May 2019

Using <f:viewParam/> in Oracle ADF


Wow! its beauty of ADF or FACETS , Here i am explain about <f:viewparam/> .

We have client requirement , user should navigate from another application that should pass URL params.

http://{hostname}/ApplicationName/faces/view1?varParam1=value1&varParam2=value2


Using unbounded taskflow , 


We will use directly #{param.varParam1}  and #{param.varParam2}on first page load .but navigating from first page to second page those URL params will be disappear and lost once we come back from second page to first page.

So to overcome this scenario use <f:viewParam/> like below so that we will maintain the values through the session.

 If we want to maintain the URL params values throughout the session we should use like below.

<af:document id="d1">
<f:metadata>
            <f:viewParam id="vp1" name="varParam1" value="#{search_s.varParam1}"/>
            <f:viewParam id="vp2" name="varParam2" value="#{search_s.varParam2}"/>

        </f:metadata>
...
...
</af:document>

here search_s is the session bean. This session scope will maintain the varParam1 and varParam2 values.

No comments:

Post a Comment