Class AbstractInputBuilder<T extends AbstractInputBuilder,VT>
- Object
-
- AbstractInputBuilder<T,VT>
-
- Direct Known Subclasses:
AbstractProductAndCustomerInputBuilder
,ButtonInputBuilder
,CollapseInputBuilder
,ConfiguratorInputBuilder
,DateRangeInputBuilder
,DmFilter
,DmFilterBuilder
,FilterBuilderInputBuilder
,InputMatrixInputBuilder
,MultiTierInputBuilder
,OptionInputBuilder
,SimpleInputBuilder
,StringInputBuilder
,VLookupBuilder
public abstract class AbstractInputBuilder<T extends AbstractInputBuilder,VT> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected InputBuilderContext
builderContext
protected ContextParameter
cp
-
Constructor Summary
Constructors Constructor Description AbstractInputBuilder(InputBuilderContext builderContext)
AbstractInputBuilder(InputBuilderContext builderContext, InputType type, String paramName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Object
_getInput()
T
addOrUpdateInput(CalculableLineItemCollectionBuilder clicBuilder, String lineId)
Adds or updates the input field in the specified header line item.T
addToConfiguratorEntry(ConfiguratorEntry ce)
Adds the created object (the input field) to the specified configurator entry (section).ContextParameter
buildContextParameter()
Builds the input field (ContextParameter
).Map<String,Object>
buildMap()
Builds the input field map (ContextParameter
converted to a map) that can be used by the
method in a header logic.addOrUpdateInput(CalculableLineItemCollectionBuilder, String)
Object
getInput()
Builds the input field (ContextParameter
).T
setAccessCode(String accessCode)
N/A - the method has not been implemented in the user interface yet.T
setAlign(String align)
N/A - the method has not been implemented in the user interface yet.T
setAlwaysEditable(Boolean ae)
Sets the input field as always editable.T
setAppearance(String appearance)
N/A - the method has not been implemented in the user interface yet.T
setAutoComplete(boolean autoComplete)
N/A - the method has not been implemented in the user interface yet.T
setAutoFocus(boolean autoFocus)
N/A - the method has not been implemented in the user interface yet.T
setCaption(String caption)
N/A - the method has not been implemented in the user interface yet.T
setConfigValues(List<String> configValues)
Adds values to the input field (parameter).T
setCustomAttributeName(String name)
Creates the custom name data attribute in the form's HTML.T
setCustomAttributeValue(String value)
Creates the custom value data attribute in the form's HTML.T
setDisabled(boolean disabled)
N/A - the method has not been implemented in the user interface yet.T
setDisplayMode(String displayMode)
N/A - the method has not been implemented in the user interface yet.T
setErrorMessage(String msg)
N/A - the method has not been implemented in the user interface yet.T
setExportable(boolean exportable)
N/A - the method has not been implemented in the user interface yet.T
setFlex(int flex)
How much space should the element take out of a row when a InputType 'ROW' is used.T
setHelpLink(String helpLink)
Displays a question mark icon next to the field label and displays the "Learn more" link when a user hovers the mouse over the icon.T
setHelpText(String helpText)
Displays a question mark icon next to the input field label and displays the specifiedhelpText
when a user hovers the mouse over this icon.T
setIcon(String icon)
N/A - the method has not been implemented in the user interface yet.T
setIconPosition(String iconPosition)
N/A - the method has not been implemented in the user interface yet.T
setImportable(boolean importable)
N/A - the method has not been implemented in the user interface yet.T
setLabel(String label)
Sets the specified text as a label of the input field.T
setLabelPlacement(String labelPlacement)
N/A - the method has not been implemented in the user interface yet.T
setLabelStyle(String labelStyle)
N/A - the method has not been implemented in the user interface yet.T
setLabelTranslations(Map<String,String> translations)
Sets the translation of the label.T
setLayoutGridName(String layoutGridName)
N/A - the method has not been implemented in the user interface yet.T
setNoRefresh(boolean noRefresh)
Prevents the form refresh when the value of the field is changed.T
setParameterGroup(String pg)
Creates collapsible sections to organize input fields in the UI.T
setPlaceholderText(String text)
Places the specified text to the input field as a placeholder.T
setReadOnly(Boolean ro)
Sets the input field as read-only.T
setRequired(Boolean required)
Sets the input field as mandatory.T
setSize(String size)
N/A - the method has not been implemented in the user interface yet.T
setSuccessMessage(String msg)
N/A - the method has not been implemented in the user interface yet.T
setTheme(String theme)
N/A - the method has not been implemented in the user interface yet.T
setTitle(String title)
Displays the specified text when a user hovers mouse over the field label.T
setUserGroupEdit(String uge)
N/A - the method has not been implemented in the user interface yet.T
setUserGroupView(String ugv)
N/A - the method has not been implemented in the user interface yet.T
setValue(VT value)
Prefills the input field with the specified value.T
setValueHint(String valueHint)
Adds the specified hint next to the input field.T
setWarningMessage(String msg)
N/A - the method has not been implemented in the user interface yet.
-
-
-
Field Detail
-
cp
protected ContextParameter cp
-
builderContext
protected final InputBuilderContext builderContext
-
-
Constructor Detail
-
AbstractInputBuilder
public AbstractInputBuilder(InputBuilderContext builderContext, InputType type, String paramName)
-
AbstractInputBuilder
public AbstractInputBuilder(InputBuilderContext builderContext)
-
-
Method Detail
-
_getInput
protected abstract Object _getInput()
-
getInput
public final Object getInput()
Builds the input field (ContextParameter
).Use this on line items logics only. Cannot be used on header logics.
Example:
if (api.isSyntaxCheck()) { api.inputBuilderFactory() .createMultiTierEntryInputBuilder("MultiTier") .setLabel("MultiTier") .setValue([ "10" : "20", "20" : "40" ]) .getInput() } else { api.input("MultiTier") }
- Returns:
- The input field (
ContextParameter
) - Since:
- 5.1 - Collins
-
setLabel
public T setLabel(String label)
Sets the specified text as a label of the input field.- Parameters:
label
- The text that is displayed as a label of the input field.- Since:
- 5.1 - Collins
-
setLabelTranslations
public T setLabelTranslations(Map<String,String> translations)
Sets the translation of the label.If the label translation is specified for a specific language then this translation is used when the UI is switched into that language.
If the 2-letter language code string is left empty, it will be used as default translation in case the UI is switched to a language, for which you did not supply the corresponding translation.
Example:
def ce = api.createConfiguratorEntry() api.inputBuilderFactory() .createStringUserEntry("InputFieldName") .setLabel("English label") .setLabelTranslations( [ "de": "Deutsche Bezeichnung", "es": "Etiqueta espaƱola" ] ) .addToConfiguratorEntry(ce) return ce
- Parameters:
translations
- The map that defines language codes (2-letterISO 639-1
) and input field labels.- Since:
- 5.2 - Collins
- See Also:
- Supported languages, How to Set Locale via URL
-
setRequired
public T setRequired(Boolean required)
Sets the input field as mandatory.The field is marked with an asterisk (*) in the user interface. The user must enter a value to this input field otherwise the form cannot be saved.
The default value:
false
- Parameters:
required
- Set totrue
to mark the input field as required in the user interface.- Since:
- 6.2 - Vesper
-
setReadOnly
public T setReadOnly(Boolean ro)
Sets the input field as read-only.The user cannot enter or edit the value in this field.
The default value:
false
- Parameters:
ro
- Set totrue
to set the input field as read-only.- Since:
- 6.2 - Vesper
-
setAlwaysEditable
public T setAlwaysEditable(Boolean ae)
Sets the input field as always editable.Enables the user to update the input field after the Quote, Contract, or Rebate Agreement have been saved.
Note: If the user has the DataIntegration user role assigned, this method may not work correctly. Always editable input fields are supported in Unity UI only (not supported in Classic UI).
The default value:
false
- Parameters:
ae
- Set totrue
to set the input field as always editable.- Since:
- 6.2 - Vesper
-
setValue
public T setValue(VT value)
Prefills the input field with the specified value.- Parameters:
value
- The value to be prefilled in the input field.- Since:
- 5.1 - Collins
-
setValueHint
public T setValueHint(String valueHint)
Adds the specified hint next to the input field.Note: This method is available only for
MultiTierEntry
- Parameters:
valueHint
- The text content of the hint.
-
setNoRefresh
public T setNoRefresh(boolean noRefresh)
Prevents the form refresh when the value of the field is changed.The default value:
false
- the form is refreshed every time when the user changes the input value.- Parameters:
noRefresh
- Set totrue
to prevent the form refresh.- Since:
- 5.1 - Collins
-
setConfigValues
public T setConfigValues(List<String> configValues)
Adds values to the input field (parameter).This can be used for example, for setting values of the drop-down input field.
- Parameters:
configValues
- The list of values you want to add to the input field (parameter).
-
setParameterGroup
public T setParameterGroup(String pg)
Creates collapsible sections to organize input fields in the UI.You can assign
parameterGroup
to each parameter (input field) to categorize them into sections. The order of parameter groups (sections) is based on the order in which they are "created" (declared) when the logic is executed. There is one default group for all those that do not haveparameterGroup
assigned.- Parameters:
pg
- The name of theparameterGroup
- Since:
- 6.2 - Vesper
-
setPlaceholderText
public T setPlaceholderText(String text)
Places the specified text to the input field as a placeholder.The placeholder text disappears once the user starts typing to this input field. This gives a user the hint of the expected value.
- Parameters:
text
- The text of the placeholder.- Since:
- 7.1 - Bijou
-
setImportable
public T setImportable(boolean importable)
N/A - the method has not been implemented in the user interface yet.The default value:
false
- Parameters:
importable
-
-
setExportable
public T setExportable(boolean exportable)
N/A - the method has not been implemented in the user interface yet.The default value:
false
- Parameters:
exportable
-
-
setTheme
public T setTheme(String theme)
N/A - the method has not been implemented in the user interface yet.- Parameters:
theme
-
-
setAppearance
public T setAppearance(String appearance)
N/A - the method has not been implemented in the user interface yet.- Parameters:
appearance
-
-
setSize
public T setSize(String size)
N/A - the method has not been implemented in the user interface yet.- Parameters:
size
-
-
setTitle
public T setTitle(String title)
Displays the specified text when a user hovers mouse over the field label.Example:
def ce = api.createConfiguratorEntry() api.inputBuilderFactory() .createStringUserEntry("InputFieldName") .setLabel("The Label") .setTitle("The Title") .addToConfiguratorEntry(ce) return ce
- Parameters:
title
- The text of the title.
-
setCaption
public T setCaption(String caption)
N/A - the method has not been implemented in the user interface yet.- Parameters:
caption
-
-
setHelpText
public T setHelpText(String helpText)
Displays a question mark icon next to the input field label and displays the specifiedhelpText
when a user hovers the mouse over this icon.- Parameters:
helpText
- The text to be displayed when a user hovers over the icon.- Since:
- 7.1 - Bijou
-
setHelpLink
public T setHelpLink(String helpLink)
Displays a question mark icon next to the field label and displays the "Learn more" link when a user hovers the mouse over the icon.Clicking on the "Learn more" text will open the specified
helpLink
destination. We recommend using this function together withsetHelpText(String)
- Parameters:
helpLink
- The target URL.- Since:
- 7.1 - Bijou
-
setIcon
public T setIcon(String icon)
N/A - the method has not been implemented in the user interface yet.- Parameters:
icon
-
-
setIconPosition
public T setIconPosition(String iconPosition)
N/A - the method has not been implemented in the user interface yet.- Parameters:
iconPosition
-
-
setLabelPlacement
public T setLabelPlacement(String labelPlacement)
N/A - the method has not been implemented in the user interface yet.- Parameters:
labelPlacement
-
-
setLayoutGridName
public T setLayoutGridName(String layoutGridName)
N/A - the method has not been implemented in the user interface yet.- Parameters:
layoutGridName
-
-
setErrorMessage
public T setErrorMessage(String msg)
N/A - the method has not been implemented in the user interface yet.- Parameters:
msg
-- Returns:
-
setWarningMessage
public T setWarningMessage(String msg)
N/A - the method has not been implemented in the user interface yet.- Parameters:
msg
-- Returns:
-
setSuccessMessage
public T setSuccessMessage(String msg)
N/A - the method has not been implemented in the user interface yet.- Parameters:
msg
-- Returns:
-
setUserGroupView
public T setUserGroupView(String ugv)
N/A - the method has not been implemented in the user interface yet.- Parameters:
ugv
-- Returns:
-
setUserGroupEdit
public T setUserGroupEdit(String uge)
N/A - the method has not been implemented in the user interface yet.- Parameters:
uge
-- Returns:
-
setDisplayMode
public T setDisplayMode(String displayMode)
N/A - the method has not been implemented in the user interface yet.- Parameters:
displayMode
-- Returns:
-
setAccessCode
public T setAccessCode(String accessCode)
N/A - the method has not been implemented in the user interface yet.- Parameters:
accessCode
-- Returns:
-
setAlign
public T setAlign(String align)
N/A - the method has not been implemented in the user interface yet.- Parameters:
align
-- Returns:
-
setLabelStyle
public T setLabelStyle(String labelStyle)
N/A - the method has not been implemented in the user interface yet.- Parameters:
labelStyle
-- Returns:
-
setAutoComplete
public T setAutoComplete(boolean autoComplete)
N/A - the method has not been implemented in the user interface yet.- Parameters:
autoComplete
-- Returns:
-
setAutoFocus
public T setAutoFocus(boolean autoFocus)
N/A - the method has not been implemented in the user interface yet.- Parameters:
autoFocus
-- Returns:
-
setDisabled
public T setDisabled(boolean disabled)
N/A - the method has not been implemented in the user interface yet.- Parameters:
disabled
-- Returns:
-
setCustomAttributeName
public T setCustomAttributeName(String name)
Creates the custom name data attribute in the form's HTML.The resulting HTML:
data-custom-AttributeName="AttributeValue"
.- Parameters:
name
- The name of the custom attribute.- Since:
- 7.1 - Bijou
-
setCustomAttributeValue
public T setCustomAttributeValue(String value)
Creates the custom value data attribute in the form's HTML.For example,
data-custom-AttributeName="AttributeValue"
.- Parameters:
value
- The value of the custom attribute.- Since:
- 7.1 - Bijou
-
setFlex
public T setFlex(int flex)
How much space should the element take out of a row when a InputType 'ROW' is used.- Parameters:
flex
- value to define how the element will grow or shrink to fit the space available.
-
buildMap
public Map<String,Object> buildMap()
Builds the input field map (ContextParameter
converted to a map) that can be used by the
method in a header logic.addOrUpdateInput(CalculableLineItemCollectionBuilder, String)
Example:
def deliveryType = api.inputBuilderFactory() .createOptionEntry("DeliveryType") .setLabel("Delivery Type") .setRequired(true) .setOptions(["Express", "Standard"]) .setLabels(["Express": "Express Delivery", "Standard": "Standard Delivery"]) .buildMap() quoteProcessor.addOrUpdateInput(deliveryType)
- Returns:
- The input field map.
- Since:
- 5.1 - Collins
-
buildContextParameter
public ContextParameter buildContextParameter()
Builds the input field (ContextParameter
).Example:
def ce = api.createConfiguratorEntry() def meatParameter = api.inputBuilderFactory() .createOptionEntry("Meat") .setOptions(["Beef", "Lamb", "Pork"]) .buildContextParameter() return ce.createParameter(meatParameter,{"Beef"})
- Returns:
- The input field (
ContextParameter
). - Since:
- 5.1 - Collins
-
addOrUpdateInput
public T addOrUpdateInput(CalculableLineItemCollectionBuilder clicBuilder, String lineId)
Adds or updates the input field in the specified header line item.Available for: Quotes, RebateAgreements and Contracts.
Example - adds the input to the QuoteBuilder at the root level:
.addOrUpdateInput(quoteProcessor, "ROOT")
- Parameters:
clicBuilder
- The clicBuilder object (quoteProcessor, raProcessor, cProcessor).lineId
- ThelineId
.- Since:
- 5.1 - Collins
-
addToConfiguratorEntry
public T addToConfiguratorEntry(ConfiguratorEntry ce)
Adds the created object (the input field) to the specified configurator entry (section).Example:
def ce = api.createConfiguratorEntry() api.inputBuilderFactory() .createStringUserEntry("StringUserEntry") .setLabel("String User Entry") .addToConfiguratorEntry(ce) return ce
- Parameters:
ce
- TheConfiguratorEntry
where you want to add the created input field object.- Since:
- 5.1 - Collins
-
-