Class AbstractProductAndCustomerInputBuilder<T extends AbstractProductAndCustomerInputBuilder,VT>
Object
AbstractInputBuilder<T,VT>
AbstractProductAndCustomerInputBuilder<T,VT>
- Direct Known Subclasses:
CustomerInputBuilder
,PCGroupInputBuilder
,ProductInputBuilder
,SellerInputBuilder
public abstract class AbstractProductAndCustomerInputBuilder<T extends AbstractProductAndCustomerInputBuilder,VT>
extends AbstractInputBuilder<T,VT>
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractInputBuilder
AbstractInputBuilder.InputWidth
-
Field Summary
Fields inherited from class AbstractInputBuilder
builderContext, cp
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractProductAndCustomerInputBuilder
(InputBuilderContext builderContext, InputType type, String paramName) -
Method Summary
Modifier and TypeMethodDescriptionsetAttributeName
(String attributeName) Sets the attribute name.setFilterFormulaName
(String filterFormulaName) Sets a filter logic.
Specifies which filter logic should be used to filter customers, products, or sellers by.setFilterFormulaParam
(String filterFormulaParam) Sets a filter logic parameter.Methods inherited from class AbstractInputBuilder
_getInput, addOrUpdateInput, addToConfiguratorEntry, addToConfiguratorEntry, buildContextParameter, buildMap, getInput, self, setAccessCode, setAlign, setAllValueTypesTracking, setAlwaysEditable, setAppearance, setAutoComplete, setAutoFocus, setCaption, setConfigValues, setCustomAttributeName, setCustomAttributeValue, setDefaultValueTracking, setDefaultWidth, setDisabled, setDisplayMode, setErrorMessage, setExportable, setFirstRunTracking, setFlex, setHelpLink, setHelpText, setIcon, setIconPosition, setImportable, setLabel, setLabelPlacement, setLabelStyle, setLabelTranslations, setLayoutGridName, setNoRefresh, setParameterGroup, setPlaceholderText, setPreviousValueTracking, setReadOnly, setRequired, setShowInline, setSize, setSuccessMessage, setTheme, setTitle, setTrackedValue, setUserGroupEdit, setUserGroupEdit, setUserGroupView, setValue, setValueChangeTracking, setValueHint, setWarningMessage, setWidth
-
Field Details
-
attributeName
-
filterFormulaName
-
filterFormulaParam
-
-
Constructor Details
-
AbstractProductAndCustomerInputBuilder
protected AbstractProductAndCustomerInputBuilder(InputBuilderContext builderContext, InputType type, String paramName)
-
-
Method Details
-
setAttributeName
Sets the attribute name.Example:
def customer = api.inputBuilderFactory() .createCustomerEntry("Customer") .setAttributeName("Test")
- Parameters:
attributeName
- Name of the attribute.- Returns:
- self
-
setFilterFormulaName
Sets a filter logic.
Specifies which filter logic should be used to filter customers, products, or sellers by.Example:
def cg = api.inputBuilderFactory() .createCustomerGroupEntry("CustomerGroup") .setFilterFormulaName("customerFilter") .setLabel("Customer Group") .getInput() return cg
- Parameters:
filterFormulaName
- The name of the filter logic that will be used to filter out items displayed by the input field.- Returns:
- self
- See Also:
-
setFilterFormulaParam
Sets a filter logic parameter. The parameter is stored into thefilterFormulaParam
variable that can be used in filter logic (see the example).When more values are passed to the variable, use
api.jsonEncode()
in the generic logic and thenapi.jsonDecode()
in the filter logic.
Example:Generic Logic Filter logic (nature: customerInputFilter, productInputFilter, sellerInputFilter) def cg = api.inputBuilderFactory() .createCustomerGroupEntry("CustomerGroup") .setFilterFormulaName("customerFilter") .setFilterFormulaParam(api.jsonEncode(["ProductCategory": "Electronics", "ProductType": "Smartphones"])) .setLabel("Customer Group") .getInput() return cg
def param = api.jsonDecode(filterFormulaParam) def productCategory = param?.ProductCategory def productType = param?.ProductType List filters = [] if (Address) { filters.add(Filter.equal("attribute1", productCategory)) } if (Phone) { filters.add(Filter.equal("attribute2", productType)) } if (filters.isEmpty()) { return null } return Filter.and(*filters)
- Parameters:
filterFormulaParam
- A filter logic parameter.- Returns:
- self
- See Also:
-
getOrCreateFilterFormula
-