Interface DynamicColumn<C extends DynamicColumn<C>>
- All Superinterfaces:
Column<C>,Comparable<C>,Component<C>,Copyable<C>,CustomCssComponent<C>,Serializable
- All Known Subinterfaces:
ConditionalColumn<C>
- All Known Implementing Classes:
DefaultConditionalColumn,DefaultDynamicColumn
Builder that is used for building ColumnTypes.DYNAMIC type column components.
This type of component is particular useful when you have a column header that may source its value from different sources depending on the row being rendered, e.g. render `variant.name` in one case, but `product.name` in another.
Columns.dynamic()
.when(Conditional.when("type").equalTo("PRODUCT"), column -> column.name("product.name"))
.when(Conditional.when("type").equalTo("VARIANT"), column -> column.name("variant.name"))
.build();
- Author:
- Dima Myroniuk (dmyroniuk), Bongani Mbigi (bongani-m)
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.broadleafcommerce.metadata.dsl.core.Column
Column.ColumnAttributes -
Field Summary
Fields inherited from interface com.broadleafcommerce.metadata.dsl.core.CustomCssComponent
CSS_ATTRIBUTE -
Method Summary
Modifier and TypeMethodDescriptiondefault Cwhen(Conditional<?> conditional, UnaryOperator<Column<?>> fn) Helper method for adding a new column option with a single conditional.default Cwhen(List<Conditional<?>> conditionals, UnaryOperator<Column<?>> fn) Helper method for adding a new column option with a list of conditionals.Methods inherited from interface com.broadleafcommerce.metadata.dsl.core.Column
addCellCssClass, addCellCssClass, addCellCssClass, addHeaderCssClass, addHeaderCssClass, addHeaderCssClass, align, alignCenter, alignLeft, alignRight, clearCellCssClasses, clearHeaderCssClasses, colSpan, colSpan, filterAndSortAlias, getAlign, getColSpan, getDataCellCssClasses, getHeaderCssClasses, getName, getWidth, isSortable, name, notSortable, removeCellCssClass, removeCellCssClass, removeCellCssClass, removeHeaderCssClass, removeHeaderCssClass, removeHeaderCssClass, setAlign, setColSpan, setName, setSortable, setWidth, sortable, sortable, widthMethods inherited from interface java.lang.Comparable
compareToMethods 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, findAttribute, findComponent, findComponent, findComponents, findEndpoint, 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, typeMethods inherited from interface com.broadleafcommerce.metadata.dsl.core.CustomCssComponent
addCssClass, addCssClass, addCssClass, clearCssClasses, getCssClasses, removeCssClass, removeCssClass, removeCssClass
-
Method Details
-
when
Helper method for adding a new column option with a single conditional.
- Parameters:
conditional- the conditional that must be true for this column to be usedfn- a function that allows configuration of the column- Returns:
- this column for further customization
-
when
Helper method for adding a new column option with a list of conditionals.
- Parameters:
conditionals- the list of conditionals that must be true for this column to be usedfn- a function that allows configuration of the column- Returns:
- the builder
-