A Better ADF Search Page - A Couple Tips and Tricks
In a recent ADF project we have been working on, another Forms Modernization, the client wanted to change our normal search page to improve the amount of real-estate dedicated to the returned results. We determined that it would help if the search component collapsed upon a successful search and originally that the header and footers on our pages collapsed also.
Using the ADF Search Component, a pageFlowScope bean, and some partial page triggers, this was very easy to accomplish.
First, create a PageFlowScope bean to hold the value and to adjust it when a search was made. This is a simple POJO with a boolean attribute, the default value for the boolean, we called "showSearch" should be set to true.
Add the bean to the taskflow as a PageFlowScope bean.
Next change the disclosed attribute of the page's query component to be based on that showSearch attribute. Update the partialTriggers on the query component to be itself.
There are probably many ways to accomplish determining if there are search results after a search and updating the bean's value; our solution was to create a processQuery method in the bean, have the bean call the default processQuery operation, then check to see if the View has a first row or not. If it does have a first row, change the value of showSearch to be "false".
Reader Comments