简体   繁体   中英

Oracle ADF::How do I pass a parameter to named query via requestScope to another view object

Question:: How can i pass the value to parameter named “userParameter” in a query. using requestScope
Kindly help out with the steps to make a request scope work on the same page.

For now I know the following.

  1. I have a page named UserRoomReservation

  2. I have a data control (UserView) Drag the first data control as a table. convert the first column to a link add actionlistener to that link from: #{row.userId} to: #{requestScope.userParameter}

  3. I created another view object via sql query I put a named parameter ":userParameter" the sql query is as written below:::

     SELECT DISTINCT Fullreservation.USERID, Meetingrooms."roomName", Meetingrooms."roomId" , COUNT (Fullreservation.roomid) AS countRoomUsage FROM FULLRESERVATION Fullreservation, "meetingRooms" Meetingrooms WHERE fullreservation.roomid = Meetingrooms."roomId" AND Fullreservation.USERID = :userParameter GROUP BY Meetingrooms."roomName", Meetingrooms."roomId", Fullreservation.USERID 
  4. I dragged it to the same page as a graph. but it doesn't work because the value hasn't been passed to the

You can get value from requestScope

ADFContext.getCurrent().getRequestScope().get(obj);

and then set this value in bind variable using NamedWhereClauseParam method

ViewObjectInstance.setNamedWhereClauseParam("BindVariabbleName",value);
ViewObjectInstance.executeQuery();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM