The queryListener
attribute of the ADF Faces Query (af:query) component indicates a method that is invoked to execute the query. By default, the framework executes the processQuery()
method referenced by the searchRegion
binding associated with the af:query
component. This is indicated by the following expression: #{bindings.SomeQuery.processQuery}
. By creating a custom query listener method, you can provide a custom implementation each time a search is performed by the af:query
component.
In this recipe, we will demonstrate how to create a custom query listener. Our custom query listener will programmatically execute the query by invoking the default expression as indicated previously. Moreover, after the query execution, it will display a message with the number of rows returned by the specific query.