Interface LookupFieldModal<V extends LookupFieldModal<V>>

  • All Superinterfaces:
    Comparable<V>, Component<V>, Copyable<V>, Grid<V>, Serializable, View<V>
    All Known Implementing Classes:
    DefaultLookupFieldModal

    public interface LookupFieldModal<V extends LookupFieldModal<V>>
    extends Grid<V>, View<V>
    Represents the metadata for the modal used by LookupField. This modal renders a list grid of the lookup's options with optional text and query builder filtering support.
    Author:
    Alexander Han (yichenhan)
    • Method Detail

      • filterByTextQuery

        default V filterByTextQuery()
        Configures this modal to support filtering by a text query input.

        This method will configure include the text query as a query parameter named LookupFieldModal.FilterParams.QUERY, for example:

         /products?q=shirt
         
        Returns:
        this
      • filterByTextQuery

        default V filterByTextQuery​(UnaryOperator<FilterAction<?>> fn)
        Configures this modal to support filtering by a text query input.

        This method will include the text query as a query parameter named LookupFieldModal.FilterParams.QUERY, for example:

         /products?q=shirt
         

        This method provides the opportunity to further customize the query filter action, for example:

         modal.filterByTextQuery(filter -> filter.label("Type your search here..."));
         
        Parameters:
        fn - the function to customize the filter action
        Returns:
        this
      • findFilterByTextQueryAction

        default Optional<FilterAction<?>> findFilterByTextQueryAction()
        Finds the filter action for the filter by text query.
        Returns:
        an optional with the action or empty
      • notFilterByTextQuery

        default V notFilterByTextQuery()
        Disables filtering by text query for this modal. This will remove the action and query parameter named LookupFieldModal.FilterParams.QUERY.
        Returns:
        this
      • filterByQueryBuilder

        default V filterByQueryBuilder()
        Configures this modal to support filtering by using a query builder to construct an RSQL query.

        This method will cause the endpoint to include the rsql query as a query parameter named LookupFieldModal.FilterParams.QUERY_BUILDER, for example:

         /products?cq=name=eq='shirt'
         
        Returns:
        this
      • filterByQueryBuilder

        default V filterByQueryBuilder​(UnaryOperator<QueryBuilderFilterAction<?>> fn)
        Configures this modal to support filtering by using a query builder to construct an RSQL query.

        This method provides the opportunity to further customize the query builder filter action, for example:

         modal.filterByQueryBuilder(filter -> filter.addField("name").addField("url"));
         
        Returns:
        this
      • findFilterByQueryBuilderAction

        default Optional<QueryBuilderFilterAction<?>> findFilterByQueryBuilderAction()
        Finds the filter action for the filter by query builder.
        Returns:
        an optional with the action or empty
      • notFilterByQueryBuilder

        default V notFilterByQueryBuilder()
        Disables filtering by the query builder for this modal. This will remove the action and query parameter named LookupFieldModal.FilterParams.QUERY_BUILDER.
        Returns:
        this