Wednesday 14 March 2012

Oracle ADF Query Component : Executing custom code before or after process query

This is more a kind of note to myself. I had to execute custom code specifically after the query component finished querying and returning its results; i.o.w. after the search button was clicked on the ADF query component and subsequently after the processQuery-method was execute. I did it as follow:

  • I added the following method to my backing bean
   public void processQuery(QueryEvent queryEvent) {   
      
// over here you can put your PRE-processQuery custom code.      

       // call the usual method as part of default query processing.
       JSFUtils.resolveMethodExpression("#     {bindings.DefaultMyVOCriteriaQuery.processQuery}",
      null, new Class[]{QueryEvent.class}, new Object[] {queryEvent});   
      

       // over here you can put your POST-processQuery custom code.      
    }

  • I changed the queryListener attribute's value, of my query component to have the value of (referencing backing bean):
 queryListener="#{viewScope.myBackingBean.processQuery}

1 comment:

  1. what's the fully qualified class name of JSFUtils? I don't see the method `resolveMethodExpression`. I could only see `resolveExpression`.

    ReplyDelete