Package io.jmix.searchui.component
Interface SearchField
- All Superinterfaces:
Component
,Component.BelongToFrame
,Component.HasCaption
,Component.HasDescription
,Component.HasIcon
,HasContextHelp
,HasHtmlCaption
,HasHtmlDescription
,HasHtmlSanitizer
,HasValue<String>
- All Known Implementing Classes:
SearchFieldImpl
@StudioComponent(caption="SearchField",
category="Search",
xmlElement="searchField",
xmlns="http://jmix.io/schema/search/ui",
xmlnsAlias="search",
icon="io/jmix/searchui/icon/searchField.svg",
canvasBehaviour=SEARCH_FIELD,
documentationURL="https://docs.jmix.io/jmix/%VERSION%/search/search-in-ui.html#search-fields",
unsupportedProperties={"colspan","rowspan"})
public interface SearchField
extends Component, Component.BelongToFrame, HasValue<String>, Component.HasCaption, HasHtmlCaption, Component.HasIcon, Component.HasDescription, HasHtmlDescription, HasContextHelp, HasHtmlSanitizer
UI component that performs full text search
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasValue
HasValue.ValueChangeEvent<V>
-
Field Summary
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
-
Method Summary
Modifier and TypeMethodDescriptionReturns the handler to be invoked when the search is successfully completed.void
Performs search.void
setEntities
(List<String> entities) Sets names of entities to search within.void
Sets the handler to be invoked when the search is successfully completed.void
setSearchStrategy
(SearchStrategy strategy) SetsSearchStrategy
to this SearchField.Methods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaption
Methods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescription
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
Methods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
Methods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
Methods inherited from interface io.jmix.ui.component.HasValue
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValue
-
Field Details
-
NAME
- See Also:
-
-
Method Details
-
getSearchStrategy
SearchStrategy getSearchStrategy()- Returns:
SearchStrategy
related to this SearchField.
-
setSearchStrategy
@StudioProperty(name="strategy", type=STRING, defaultValue="anyTermAnyField", options={"anyTermAnyField","allTermsAnyField","allTermsSingleField","phrase"}) void setSearchStrategy(SearchStrategy strategy) SetsSearchStrategy
to this SearchField.- Parameters:
strategy
-SearchStrategy
-
getEntities
- Returns:
- Names of entities configured to search within
-
setEntities
Sets names of entities to search within.- Parameters:
entities
- List of entity names
-
performSearch
void performSearch()Performs search. -
setSearchCompletedHandler
Sets the handler to be invoked when the search is successfully completed.The preferred way to set the handler is using a controller method annotated with
Install
, e.g.:@Install(to = "mySearchField", subject = "searchCompletedHandler") public void mySearchFieldSearchCompletedHandler(SearchField.SearchCompletedEvent event) { SearchResult searchResult = event.getSearchResult(); //... }
- Parameters:
handler
- handler
-
getSearchCompletedHandler
Consumer<SearchField.SearchCompletedEvent> getSearchCompletedHandler()Returns the handler to be invoked when the search is successfully completed.- Returns:
- handler
-