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

Vivek Tiwari picture Vivek Tiwari · Mar 6, 2013 · Viewed 15.6k times · Source

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?

Answer

Sam picture Sam · Mar 7, 2013

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