public class VariantSelectorController extends AbstractImpersonationController
variantselector| Modifier and Type | Field and Description |
|---|---|
static String |
ATTRIBUTE_OPTION_KEY |
static String |
ATTRIBUTE_OPTION_LABEL |
static String |
LABEL_VARIANTOPTIONQUALIFIER_VALUE_EMPTY |
protected Map<String,String> |
lastSelectedValueForOptionTitle |
static String |
SCLASS_VARIANTOPTION_CNT |
static String |
SCLASS_VARIANTOPTION_LABEL |
static String |
SETTING_DECORATE_VARIANT_OPTION_LABEL |
static String |
SETTING_LISTBOX_MOLD |
static String |
SETTING_SELECT_DEFAULT |
static String |
SETTING_SMARTRENDER
The setting key to toggle the rendering mode.
|
static String |
SETTING_VARIANT_ATTRIBUTE_NAME_SEPARATOR |
static String |
SOCKET_IN_PRODUCT |
static String |
SOCKET_OUT_VARIANT |
protected Div |
variantSelectorComponent |
| Constructor and Description |
|---|
VariantSelectorController() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
createOptionKey(VariantOptionData variantOptionData)
Creates the title representation for the given variantOptionData.
|
protected String |
createOptionLabel(VariantOptionData variantOptionData,
boolean combined,
Map<String,String> variantAttributesVisibility)
Creates the label representation for the given variantOptionData.
|
protected String |
decorateOptionComboitemLabel(String optionValueLabel,
VariantOptionData variantOptionData)
Adds additional information to the displayed label for a variant option.
|
protected String |
getDefaultOptionCode(List<VariantOptionData> options)
Gets a default option code for a list of options, using some cache that stores the last selected option for a
particular title.
|
protected String |
getOptionQualifierSeparator()
Returns configured variant qualifier separator
|
protected ProductFacade |
getProductFacade() |
protected void |
renderOptionSelector(List<VariantOptionData> options,
VariantOptionData selectedOption,
Component parent,
boolean combined)
Creates a select component (i.e.
|
void |
renderVariantSelector(ProductData product)
Draws product variant selector for the given
ProductData. |
protected void |
selectVariant(String code)
Gets the product with the specified code from the
ProductFacade and sends it to output socket "variant". |
void |
setProductFacade(ProductFacade productFacade) |
createImpersonationContext, executeInContext, getCatalogVersionService, getContextCatalogVersions, getContextCurrency, getContextLanguage, getImpersonationService, getInStoreService, getSearchRestrictionService, getSessionService, getUserService, setCatalogVersionService, setImpersonationService, setInStoreService, setSearchRestrictionService, setSessionService, setUserServicepublic static final String SCLASS_VARIANTOPTION_CNT
public static final String SCLASS_VARIANTOPTION_LABEL
public static final String LABEL_VARIANTOPTIONQUALIFIER_VALUE_EMPTY
public static final String ATTRIBUTE_OPTION_LABEL
public static final String ATTRIBUTE_OPTION_KEY
public static final String SOCKET_OUT_VARIANT
public static final String SOCKET_IN_PRODUCT
public static final String SETTING_VARIANT_ATTRIBUTE_NAME_SEPARATOR
public static final String SETTING_DECORATE_VARIANT_OPTION_LABEL
public static final String SETTING_SELECT_DEFAULT
public static final String SETTING_LISTBOX_MOLD
public static final String SETTING_SMARTRENDER
protected Div variantSelectorComponent
public void renderVariantSelector(ProductData product)
ProductData.product - to get the variants fromprotected void renderOptionSelector(List<VariantOptionData> options, VariantOptionData selectedOption, Component parent, boolean combined)
Listbox) and adds it to the specified parent component.protected void selectVariant(String code)
ProductFacade and sends it to output socket "variant".
If widget setting "selectDefaultVariant" is true, a default variant option will be set.code - The product code.protected String decorateOptionComboitemLabel(String optionValueLabel, VariantOptionData variantOptionData)
optionValueLabel - The default label.variantOptionData - The variant option from which you can get additional information.protected String getDefaultOptionCode(List<VariantOptionData> options)
protected String createOptionLabel(VariantOptionData variantOptionData, boolean combined, Map<String,String> variantAttributesVisibility)
protected String getOptionQualifierSeparator()
protected String createOptionKey(VariantOptionData variantOptionData)
protected ProductFacade getProductFacade()
public void setProductFacade(ProductFacade productFacade)
Copyright © 2017 SAP SE. All Rights Reserved.