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
  • Field Details

  • 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)
      Sets SearchStrategy to this SearchField.
      Parameters:
      strategy - SearchStrategy
    • getEntities

      List<String> getEntities()
      Returns:
      Names of entities configured to search within
    • setEntities

      @StudioProperty(name="entities", type=ENTITY_NAMES) void setEntities(List<String> entities)
      Sets names of entities to search within.
      Parameters:
      entities - List of entity names
    • performSearch

      void performSearch()
      Performs search.
    • setSearchCompletedHandler

      void setSearchCompletedHandler(Consumer<SearchField.SearchCompletedEvent> handler)
      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