Sunday, August 15, 2010

Pass a parameter to a Page in ADF and execute a query.

Having worked with Oracle Forms for 20 years I have become accustomed to developing forms and applications in a certain manner. My progression to Jdeveloper ADF has meant that a lot that I took for granted about how to build forms and add functionality to them is no longer the case and I must use different methods to achieve the desired result.

To execute a query with a passed parameter in forms I would use a pre-query trigger to copy the parameter to the requisite field and then execute the query.

In ADF I can use the ExecuteWithParameters operation but only if I have first created the view with a bind-variable that I intend to use. So far OK.

The standard way we are instructed to do this is to add an action binding in the page definition to the ExecuteWithParameters operation, set the parameter we are going to use and use an invokeAction in the executables to bind to the action and fire on page-loading.

I am using a Bounded task flow with page fragments. The page I am calling can be called from numerous points in the Bounded task flow, each point setting a parameter (in my case {pageFlowScope.<>>}.
No matter which way I passed the parameter to the ExecuteWithParameters  action it failed to recognise or use the parameter, executing with a null value or whatever default value I set for the bind-variable.

The solution, dispense with the ExecuteWithparameters and invokeAction on the page and use a method call bound to executeWithParameters call on the page instead. It works perfectly.

I'm not sure if this is a bug or just something I was doing but I shall use the Method Call in my bounded taskflow in future.

No comments:

Post a Comment