WebSphere Dashboard Framework - Best practices
for using query filters
Follow these best practices for building applications that use query filters.
Add a Query Filter Observer portlet
When you create a Query Filter portlet, also create a sample Query Filter
Observer portlet that shows you the actual values that are in session.
You can then add this observer portlet to your portal page.
To create a Query Filter Observer model, add a Data Page builder and point
it at the Query Filter data variable. If you add filters to your Query
Filter model or remove them, you will need to regenerate the Observer model
in order to see the new filters.
Use the method webAppAccess.setCurrentPage to load a page
When the Query Filter Observer is called, it creates an OnRequest event
that observes the filter's change and starts the actions specified in the
builder's inputs. In a WebSphere Portal server environment, the OnRequest
handler fires twice, once for the observer's action request and once for
a page render request, resulting in duplicate elements being displayed
on the page. The Process Page action is an example of a render request
that results in duplicate elements on the page. To work around this default
behavior, use the method webAppAccess.setCurrentPage("pageName")
instead of webAppAccess.processPage("pageName") to load the page.
Create custom date ranges for more flexibility
If you are using a Date Range Query Filter you may want to create your
own date ranges (last week, last fiscal year) for the drop down selector.
Use a Rich Data Definition builder for a nicer user interface
Use Rich Data Definition (RDD) to enhance the user interface for the Query
Filter. For example, use RDD to set date formatting and add calendar pickers
to the Start Date and End Date inputs in a Date Range.
Set up role-based profiling
It is common to have role-based profiling affect the levels of a Data Hierarchy
Query Filter. For example, the Sales vice president starts with the Region
drop-down, but a Regional Manager starts with the Office drop-down for
his office. It is worth setting this up early to test the role-based profiling.