This discussion is archived
2 Replies Latest reply: Jul 9, 2013 12:22 AM by ac4991 RSS

OAF Handling Post QueryBean Execution

ac4991 Newbie
Currently Being Moderated

Hi Experts,

 

How to override or extend a queryBean VO execution?

 

To elaborate, i want to add custom logic after the queryBean has been executed. Or we can say, each time the VO is executed after that the custom logic should run.


Regards

Ari

  • 1. Re: OAF Handling Post QueryBean Execution
    Swati Explorer
    Currently Being Moderated

    Hi,

     

    I don't know the best approach but I follow following,

     

    1) If you want to execute any business logic Before the Query Bean VO Execution: Write logic under the procedure named "processFormData(pageContext,webBean)"

     

    2) If you want to execute any business logic After the Query Bean VO Execution: Write logic under the procedure named "processFormRequest(pageContext,webBean)".

     

    You can catch the event using following Reference Code:

    OAQueryBean queryRN = (OAQueryBean) webBean.findChildRecursive(<Id of your Query Region>);

     

          // queryRN.getGoButtonName() returns name like "customizeSubmitButton"

            if(pageContext.getParameter(queryRN.getGoButtonName()) != null)        {

                // Custom Logic

            }

    You can also customize different code for Simple Search Query Bean and Advanced Search Query Bean.

     

    Hope this helps.

     

    Swati

  • 2. Re: OAF Handling Post QueryBean Execution
    ac4991 Newbie
    Currently Being Moderated

    Hi Swati,

     

    Thanks for the immediate response.

     

    I did try the latter option:

    2) If you want to execute any business logic After the Query Bean VO Execution: Write logic under the procedure named "processFormRequest(pageContext,webBean)".

     

    You can catch the event using following Reference Code:

    OAQueryBean queryRN = (OAQueryBean) webBean.findChildRecursive(<Id of your Query Region>);

     

          // queryRN.getGoButtonName() returns name like "customizeSubmitButton"

            if(pageContext.getParameter(queryRN.getGoButtonName()) != null)        {

                // Custom Logic

            }

    But what i found it doing was that, it executes the controller code before the actual queryBean execution. So, there i get no records fetched from the VO.

     

    Another issue which i'd like to add to this thread is that:

    although after the queryBean gets executed, the framework automatically brings the records according to the search panel criteria provided. But when i programmatically get the values for vo.getFetchedRowCount or vo.getQuery it shows me the complete pool of data and not the filtered one.

     

    For E.g. according to VO query (defined at design time) the query fetches 200 records, now while we provide criteria in the search page and press Go button we get 5 records. But when i programmatically get the values for vo.getFetchedRowCount it shows me 200 and for vo.getQuery its the design time query exclusive of the criteria (No WHERE clause).

     

    Plz can you interpret this situation? ..

     

    Regards

    Ari

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points