fullTextFilter
|
This component requires the free Search add-on. |
fullTextFilter functions similarly to propertyFilter but performs full-text search across indexed entity fields.
XML Element |
|
|---|---|
Java Class |
|
Basics
Declare the search namespace in the view’s XML descriptor:
<view xmlns="http://jmix.io/schema/flowui/view"
xmlns:search="http://jmix.io/schema/search/ui"
title="msg://searchView.title">
|
Studio adds the namespace automatically when you add the component using the Add Component action in the top actions panel. See Component Palette. |
Bind fullTextFilter to a collection data loader using the required dataLoader attribute. The following example declares the data, filter, and results grid:
<data>
<collection id="ordersDc"
class="com.company.demo.entity.Order">
<loader id="ordersDl"
readOnly="true">
<query>
<![CDATA[select e from Order_ e]]>
</query>
</loader>
<fetchPlan extends="_base">
<property name="customer"
fetchPlan="_base"/>
</fetchPlan>
</collection>
</data>
<facets>
<dataLoadCoordinator auto="true"/>
</facets>
<layout>
<search:fullTextFilter dataLoader="ordersDl"
autoApply="true"/>
<dataGrid id="ordersDataGrid"
width="100%"
dataContainer="ordersDc">
<columns>
<column property="number"/>
<column property="date"/>
<column property="amount"/>
<column property="product"/>
<column property="customer"/>
</columns>
</dataGrid>
</layout>
The FullTextFilter component operates as follows:
-
Performs a full-text search to find entity identifiers matching the search criteria.
-
Appends a condition containing these identifiers to the associated
dataLoader. -
When a
DataGrid(or other listing component) is linked to this data loader, it displays only those records that match the full-text search criteria.
The full-text condition combines with any other filters applied to the data loader, providing refined result sets.
Validation
To check values entered into the fullTextFilter component, you can use a validator in a nested validators element.
The following predefined validators are available for fullTextFilter:
XML Element |
|
|---|---|
elements |
custom - decimalMax - decimalMin - digits - doubleMax - doubleMin - email - future - futureOrPresent - max - min - negative - negativeOrZero - notBlank - notEmpty - notNull - past - pastOrPresent - positive - positiveOrZero - regexp - size |
Attributes
The following attributes are specific to fullTextFilter:
| Name | Description | Default |
|---|---|---|
When set to |
||
Sets the required data loader filtered by this component. It must be a collection loader. |
— |
|
Sets the position of the label relative to the filter value component. See propertyFilter label position. |
— |
|
Sets the label width as a CSS length. See propertyFilter label width. |
— |
|
Determines the search strategy applied. See Search Strategies. |
The following shared attributes are supported by fullTextFilter:
id - alignSelf - ariaLabel - ariaLabelledBy - classNames - colspan - css - defaultValue - enabled - errorMessage - focusShortcut - height - helperText - justifySelf - label - labelVisible - maxHeight - maxWidth - minHeight - minWidth - parameterName - readOnly - required - requiredMessage - tabIndex - themeNames - visible - width
Handlers
The following handlers are specific to fullTextFilter:
| Name | Description |
|---|---|
Validates the component value. |
The following shared handlers are supported by fullTextFilter: