Its recommended for performance reasons to avoid query automatically on large data sets, naturally we are not performing query by default in today sample application:

In order to have more complex case, let's declare required query criteria parameters. Finally, our query and results table will look like this:

In my sample, if user will press Reset button in af:query, results table will be cleared:

However, by default only query criteria parameters are cleared, results table will remain populated. In order to clear results table, I have implemented query operation listener in Backing Bean, where I'm calling Application Module method and triggering partial refresh for results table:

Custom method implemented in Application Module - doQueryResultReset() invokes executeEmptyRowSet() in order to clear rows from iterator. Additionally in our case, because we have required query criteria parameters, we need to remove View Criteria before invoking executeEmptyRowSet() and reapply it again:

Download sample application - QueryReset.zip
10 comments:
hi
See also some executeEmptyRowSet() related forum messages here
http://forums.oracle.com/forums/message.jspa?messageID=3788453#3788453
regards
Jan Vervecken
Thanks Jan,
Additionally can check here: http://andrejusb.blogspot.com/2009/08/oracle-adf-tuning-preventing-sql-query.html
Andrejus
hi
in my case, i have one required field (adf 11.1.1.0.1)
i have cleared the view criteria (same as your with "removeviewcriteria".
but i have required field error message.
(something can be forget or not say ?)
thanks
sorry, you can delete previous comment...
I want to capture query component mode(Basic | Advanced) in processQuery event listener method for QueryEvent as below:
public void processQuery(QueryEvent queryEvent) { // Add event code here... QueryDescriptor qdesc = queryEvent.getDescriptor(); String searchName = qdesc.getName(); String queryMode =?
I tried to get this value from getUIHints() map using UIHINT_MODE key. but getUIHints() returns empty map.
Hi,
You can probably use ViewCriteriaHints and set property programmatically. Using setProperty() method on ViewCriteria object.
Regards,
Andrejus
Thanks Andrejus Baranovskis,
i want to handle reset query in the LOV item.
regards
Amr Rashed
Andrejus,
When user clicks on clear, I need to set an Criteria Item with specific Value Derived at runtime. Is it possible to do so?
Thanks,
Chaitanya Varma
Is there a way to auto change the search results when the user chooses a new saved search rather then requiring user to click on the Search Button? What would I use to capture the change event for the user saved search selection -- as you have done with the Reset? Ideally there would be a button beside the saved search so user does not have to OPEN the search each time they want to change a saved search to a different query result set.
Thank you Andrejus Baranovskis
It was very usefull. But can u pls give me a blog in which the advance link in ADF Quick Query panel Such that when user clicks the link it must change into advance mode of af:Query
Post a Comment