Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use session attribute value with the where clause in Business component view object query.?

Tags:

oracle-adf

In the sessionScoped managed bean(registered managed bean in the bounded task flow and also in the adfc-config.xml file) in ADF fusion web application I had set the attribute in the session as

FacesContext fctx = FacesContext.getCurrentInstance();
ExternalContext ectx = fctx.getExternalContext();
HttpSession userSession = (HttpSession) ectx.getSession(false);
userSession.setAttribute("compID", defaultCompany);

the session attribute is working fine in the bean and the value is being displayed in the jsff page of the bounded task flow and also on the jsf page which contains the bounded task flow as region

im getting the session attribute value on the page using the expression

"#{sessionScope.compID}" 

inside the output text value property, but not able to get the value in the model project which contains the business components. I want to use the compID session attribute value in the query

Select.........where COMP_ID ='compID';

by setting the value in the bind variable value property and passing the newly creted bid variable in the where clause but its not working

so i how to use this dynamic session attribute value in the where clause of the query of the business component view object?

like image 659
Vivek Tiwari Avatar asked Feb 17 '23 07:02

Vivek Tiwari


2 Answers

You could try doing what's mentioned in the below blog

http://andrejusb.blogspot.com/2012/01/how-to-access-session-scope-in-adf-bc.html

like image 133
Sam Avatar answered Mar 29 '23 23:03

Sam


You need a service method on your VO or AM that accepts a parameter - you call this method in your JSF page and pass the session scope as the parameter. An example: https://blogs.oracle.com/shay/entry/passing_parameters_to_an_adf_p or https://blogs.oracle.com/shay/entry/am_service_method_-_simple_dem

like image 27
Shay Shmeltzer Avatar answered Mar 30 '23 00:03

Shay Shmeltzer