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 byLookupField
. This modal renders a list grid of the lookup's options with optional text and query builder filtering support.- Author:
- Alexander Han (yichenhan)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
LookupFieldModal.ActionKeys
static class
LookupFieldModal.FilterKeys
static class
LookupFieldModal.FilterParams
static class
LookupFieldModal.FilterPlacements
static class
LookupFieldModal.FilterTypes
-
Nested classes/interfaces inherited from interface com.broadleafcommerce.metadata.dsl.core.extension.Grid
Grid.Attributes, Grid.Keys
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default V
filterByQueryBuilder()
Configures this modal to support filtering by using a query builder to construct an RSQL query.default V
filterByQueryBuilder(UnaryOperator<QueryBuilderFilterAction<?>> fn)
Configures this modal to support filtering by using a query builder to construct an RSQL query.default V
filterByTextQuery()
Configures this modal to support filtering by a text query input.default V
filterByTextQuery(UnaryOperator<FilterAction<?>> fn)
Configures this modal to support filtering by a text query input.default Optional<QueryBuilderFilterAction<?>>
findFilterByQueryBuilderAction()
Finds the filter action for the filter by query builder.default Optional<FilterAction<?>>
findFilterByTextQueryAction()
Finds the filter action for the filter by text query.default V
notFilterByQueryBuilder()
Disables filtering by the query builder for this modal.default V
notFilterByTextQuery()
Disables filtering by text query for this modal.default V
removeQueryFilter(String filterKey)
Remove the filter action placed as aLookupFieldModal.FilterPlacements.QUERY_FILTER
with the filter key.-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface com.broadleafcommerce.metadata.dsl.core.Component
addAction, addAction, addComponent, addEndpoint, addEndpoint, apply, attribute, augmentationKey, classifier, clearConditionals, clearEndpoints, conditional, conditionals, description, description, findAction, findAction, findActions, findAttribute, findComponent, findComponent, findComponents, findEndpoint, findEndpoint, findEndpoints, get, get, getAction, getAction, getActions, getActionsList, getAttribute, getAttribute, getAttributes, getAugmentationKey, getClassifier, getComponent, getComponent, getComponents, getComponentsList, getConditionals, getDescription, getEndpoint, getEndpoint, getEndpoints, getEndpointsList, getId, getLabel, getOrder, getScope, getType, hasAction, hasAttribute, hasComponent, hasEndpoint, id, isAugmentable, isTranslatable, label, label, notTranslatable, order, removeAction, removeAttribute, removeComponent, removeEndpoint, scope, self, setActions, setAttributes, setAugmentationKey, setClassifier, setComponents, setConditionals, setDescription, setEndpoints, setId, setLabel, setOrder, setScope, setTranslatable, setType, translatable, translatable, type
-
Methods inherited from interface com.broadleafcommerce.metadata.dsl.core.extension.Grid
addColumn, addColumn, addColumn, addColumns, findColumn, getColumn, idKey, removeColumn
-
-
-
-
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 namedLookupFieldModal.FilterParams.QUERY
.- Returns:
- this
-
removeQueryFilter
default V removeQueryFilter(String filterKey)
Remove the filter action placed as aLookupFieldModal.FilterPlacements.QUERY_FILTER
with the filter key.- Parameters:
filterKey
- the filter key- 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 namedLookupFieldModal.FilterParams.QUERY_BUILDER
.- Returns:
- this
-
-