System-wide parameters
The following application properties affect filter behavior:
-
cuba.gui.genericFilterManualApplyRequired − disables automatic applying of the filter (i.e., data loading) when the screen is opened.
-
cuba.gui.genericFilterChecking − enables the check that at least one condition is filled before applying the filter.
-
cuba.gui.genericFilterControlsLayout − defines an internal layout of the filter controls.
-
cuba.allowQueryFromSelected enables sequential filters application mechanism.
-
cuba.gui.genericFilterColumnsQty - sets the default number of columns for placing conditions on the filter panel.
-
cuba.gui.genericFilterConditionsLocation - defines the location of the conditions panel.
-
cuba.gui.genericFilterPopupListSize - defines the maximum number of items displayed in the popup list of the button.
Screen invocation parameters
It is possible to specify the filter and parameters which should be applied when the screen is opened. For this purpose, the filter should be created in advance, stored in the database, and a corresponding entry in the SEC_FILTER table should have the CODE field set.
To specify a filter code, pass to the screen a parameter with the same name as filter component identifier in this screen . Parameter value should be the code of the filter, which should be set and applied.
To set filter parameter values, passed to the screen parameters with the names equal to parameter names and their values in string format.
An example of main menu item descriptor is shown below. It sets a filter with the FilterByVIN
code to the carsFilter
component of the sample$Car.browse
screen which it opens. It also sets TMA
value to the $carsFilter.vin79216
condition:
<item id="sample$Car.browse"> <param name="carsFilter" value="FilterByVIN"/> <param name="component$carsFilter.vin79216" value="TMA"/> </item>
It should be noted that that a filter with a defined CODE field has some specifics:
-
It cannot be edited by users.
-
This filter name can be displayed in several languages. To achieve this, specify a string with key equal to the filter code in the application main message pack.