Mini Filters
|
The tutorial VLF010WIN - Creating a Mini Filter shows how to create a mini filter.
A mini filter very similar to a hidden filter. The difference is that a mini filter still requests a search value from the user, using a field and search button that exist permanently on the Framework identification bar (the field and search button are only visible if a mini filter is being used).
The filter sets up the search field and button on the identification bar. The filter itself is hidden. The user enters a search value into the search field on the identification bar and presses the button on the identification bar. This executes the filter, which gets the value that the user entered, and uses it to do a search and put the result on the instance list.
The filter sets up and communicates with the search field on the identification bar using Framework properties.
Send PropertiesWindows:
Set #Com_Owner avMiniFilter(TRUE)
set #Com_Owner avMiniFiltFldCap1('Search for')
set #Com_Owner avMiniFiltValue1('<<Initial search value>>')
set #Com_Owner avMiniFiltButtonCap1('Search')
Receive Properties
It receives the value in a search field by reading the Framework property for that search field:
USE BUILTIN(VF_GET) WITH_ARGS(AVMINIFILTVALUE1 *BLANKS) TO_GET(#ALPHASEARCH)
Windows:
Windows filters receive information as parameters of a method routine. This includes the number of the button that was pressed.
Mthroutine Name(uMiniFilterButton) Desc('Handle a mini filter button click') Help('Overwrite this method with your own logic if required.') Options(*REDEFINE)
* Define_Map For(*input) Class(#vf_elnum) Name(#uButton)
* Define_Map For(*input) Class(#vf_elurl) Name(#uValue1) Mandatory(' ')
* Define_Map For(*input) Class(#vf_elurl) Name(#uValue2) Mandatory(' ')
* Define_Map For(*input) Class(#vf_elurl) Name(#uValue3) Mandatory(' ')
There can be up to 3 search fields and up to 3 buttons. The search fields are always alpha – if the user enters a numeric value, the RDML of the filter could be coded to convert it to numeric and issue a message if there is a problem.
The routine in the filter that handles a click of a button has access to the values in any of the 3 fields.
If a mini filter is being used, then there should only be one filter for the business object. The reason for having a mini filter is to save space to allow the instance list to be wider, so if there are other filters you should use a normal filter, not a mini filter.