Class ContextParameter
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionContextParameter(String name, DMFieldCollection fc, String field, String defaultValue) ContextParameter(InputType type, String name) ContextParameter(InputType type, String name, Object value) ContextParameter(LookupTable lt, String defaultValue) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInput(ContextParameter contextParameter) Adds a nested input.voidaddParameterConfigEntry(String key, Object value) Technically the same functionality assetConfigParameter(String, Object).voidclearConfigParameter(String paramName) booleangetLabel()getName()PersistedObjectServicegetType()getURL()getValue()String[]inthashCode()final booleanbooleanbooleanfinal booleanbooleanfinal booleanfinal booleanfinal booleanfinal booleanfinal booleansetAddUnknownValues(Boolean addUnknownValues) setAlwaysEditable(Boolean alwaysEditable) setConfigParameter(String paramName, Object value) Adds an additional configuration parameter/option to the input – aparameterConfigproperty.setFilters(Filter... filters) setFormattingOption(String optionName, Object value) Sets (adds or updates) a formatting option (how the input field is displayed) within the formattingOptions map.voidsetFormattingOptions(Map<String, Object> formattingOptions) Allows you to set desired formatting options of the input field as a map.voidsetIfNotNull(ContextParameter original) Copy attributes from the originalContextParameterapart from:name,lookupTableId,type,inputsandvalueHintSets the label of the input parameter to the given text.setLabelTranslations(String labelTranslations) setLabelTranslationsFromMap(Map<String, String> translations) setLogActivity(Boolean logActivity) setParameterConfig(Map<String, Object> parameterConfig) Sets the behavior of the input field.setParameterGroup(String parameterGroup) Allows you to create collapsible sections that organize inputs in the UI.setReadOnly(Boolean readOnly) setRequired(Boolean required) Sets, if it's mandatory for the input parameter to have a value.setStoreAuditTrail(Boolean storeAuditTrail) setTypedId(String typedId) voidsetUserGroupEdit(String userGroupEdit) setUserGroupView(String userGroupView) Sets the userGroupView property for the input.setUserGroupView(List<String> userGroupsView) Sets the userGroupView property for the input.Set initial/default value of the input parameter.setValueHint(String hint) setValueOptions(String[] valueOptions) Sets list of options used in the dropdown input field.setValueOptions(List<String> valueOptions) toString()voidvoidupdateFromFormulaInputDescriptor(FormulaInputDescriptor fid) voidThis is a convenience method to update a ContextParameter with a new version of the same lookup table This can happen e.g. if a quote is worked on a while and passes a validity date border or an old quote is copied
-
Constructor Details
-
ContextParameter
public ContextParameter() -
ContextParameter
-
ContextParameter
-
ContextParameter
-
ContextParameter
-
ContextParameter
-
-
Method Details
-
updateFromFormulaInputDescriptor
public void updateFromFormulaInputDescriptor(FormulaInputDescriptor fid) -
addParameterConfigEntry
Technically the same functionality assetConfigParameter(String, Object).- Parameters:
key-value-- See Also:
-
updateWithLookupTable
This is a convenience method to update a ContextParameter with a new version of the same lookup table This can happen e.g. if a quote is worked on a while and passes a validity date border or an old quote is copied- Parameters:
lt-
-
isLookupType
public boolean isLookupType() -
isCustomerParam
public final boolean isCustomerParam() -
isProductParam
public final boolean isProductParam() -
isProductGroupParam
public final boolean isProductGroupParam() -
isMatrixParam
public final boolean isMatrixParam() -
isOptionParam
public final boolean isOptionParam() -
isOptionsParam
public final boolean isOptionsParam() -
isHiddenParam
public final boolean isHiddenParam() -
isEnableClientFilter
public boolean isEnableClientFilter()- Returns:
- the boolean flag informing whether the client filer is on (
true) or off (false) Turn on by the default - Since:
- 13.0 - Rampur
- See Also:
-
isEnableAdvancedFilter
public boolean isEnableAdvancedFilter()- Returns:
- the boolean flag informing whether the advanced filer is on (
true) or off (false) Turn off by the default - Since:
- 13.0 - Rampur
- See Also:
-
getPreferenceName
-
isRequired
-
setRequired
Sets, if it's mandatory for the input parameter to have a value. The value can be either entered by user or a default value. If the input value is required, but not provided, then it's usually somehow expressed on the screen (usually exclamation mark).In case of Quote, all required fields must be populated, otherwise you cannot submit the Quote for approval.
- Parameters:
required- If the input value will be required or not.
-
getName
-
getLabel
-
setLabel
Sets the label of the input parameter to the given text.- Parameters:
label- The text to be displayed as label of the input field.
-
getLabelTranslations
-
setLabelTranslationsFromMap
-
setLabelTranslations
-
getFilter
-
setFilter
-
setFilters
-
getParameterGroup
-
setParameterGroup
Allows you to create collapsible sections that organize inputs in the UI. You can assign parameterGroup to each parameter, and they will get categorized. 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 have parameterGroup assigned.This is supported for Quotes, Contracts and Rebate Agreements (not for Configurators).
-
getURL
-
setURL
-
getType
-
getInputType
-
applyType
-
getValueHint
-
setValueHint
-
getValueOptions
-
setValueOptions
Sets list of options used in the dropdown input field. This works only for input parameters created viaapi.option()andapi.options()Example:
api.option("Country") // ... api.getParameter("Country").setValueOptions(["USA", "DE"])- Parameters:
valueOptions-
-
setValueOptions
-
getLookupTableId
-
getValue
-
setValue
Set initial/default value of the input parameter.Important: this makes sense only during the SyntaxCheck execution mode. You cannot set the initial value of input field later during regular execution.
- Parameters:
value-
-
getReadOnly
-
setReadOnly
-
setParameterConfig
Sets the behavior of the input field.Example:
PriceParam?.setParameterConfig(["formatType": "MONEY_USD","dataType":"float"])- Parameters:
parameterConfig-Config parametersas a map.- Returns:
- See Also:
-
getParameterConfig
-
setUserGroupView
Sets the userGroupView property for the input.
nullwhich means no restrictions.NOTE:
- the property is set as a configuration parameter
- if concatenation of
userGroupNames(with comma delimiter) exceeds theDB_MAX_STRING_LENGTHcharacters limit, the value is not set - each usage of the method on a single input will override the value
- Parameters:
userGroupView- a user group name
-
setUserGroupView
Sets the userGroupView property for the input.
nullor emptyCollectionsets the property tonullwhich means no restrictions.NOTE:
- the property is set as a configuration parameter
- if concatenation of
userGroupNames(with comma delimiter) exceeds theDB_MAX_STRING_LENGTHcharacters limit, the value is not set - each usage of the method on a single input will override the value
- Parameters:
userGroupsView- a user group name
-
getUserGroupView
-
setUserGroupEdit
-
getUserGroupEdit
-
setConfigParameter
Adds an additional configuration parameter/option to the input – aparameterConfigproperty. This option modifies how the input field behaves.You can use following
paramNamewith respective values:paramName Description formatTypeSets the format type of the input field (e.g. for "PERCENT" the input will be displayed with % sign and the value returned will be 0..1 instead of 0..100). For possible values, see the FieldFormatTypeenum.fromSets the minimum value of the allowed value range. Applicable to the following input types: INTEGERUSERENTRY, USERENTRY, DATETIMEUSERENTRY (accepts date limits only), DATEUSERENTRY, SLIDER. toSets the maximum value of the allowed value range. Applicable to the following input types: INTEGERUSERENTRY, USERENTRY, DATETIMEUSERENTRY (accepts date limits only), DATEUSERENTRY, SLIDER. labelsSets labels to be used for the options, For example ["USA":"United States of America, "DE":"Germany]. Applicable to the OPTION input type. disabledHides the input from the user interface. Supported input types: InputType.CONFIGURATOR(hides the "Open" button).dataTypeSets the data type of the input field. For example "float", or "integer". Applicable to the following input types: USERENTRY, BOOLEANUSERENTRY, DATEUSERENTRY, DATETIMEUSERENTRY, HIDDEN, INTEGERUSERENTRY, PARSABLEINPUTFILE, QUOTETYPE, REBATEAGREEMENT, TEXTUSERENTRY, TIMEUSERENTRY. noRefreshBoolean – Applicable to input fields within a Configurator only. Prevents the Configurator refresh when the value of the field is changed. See AbstractInputBuilder.setNoRefresh(boolean)setNoRefresh()} for more details.dmSourceNameName of DS or DM (only for DMFilterBuilder, DMFields or DMField). typeCodeString – sets the type to be filtered. For FILTERBUILDER input type only. targetPageOpens the target location (AppPage). Applicable to the BUTTON input type only. See setTargetPage()for more details.targetPageStateOpens the particular object detail in the specified location (set by the targetPage). Applicable to the BUTTON input type only. SeesetTargetPageState()for more details.filterFormulaName of the logic which will provide a filter used to limit products/customers in the picker. Example: cp.setConfigParameter("filterFormula", ["name": * <td>Boolean – If this is set to true, browser scrolls to the element when the page is loaded and automatically focuses it (places a cursor into the input field). For the radio group, the first element will be focused. If the input is in the read-only mode, autofocus will not be applied.</td> * </tr> "ProductFilter_Logic"]). Applicable to the following input types: PRODUCT, PRODUCTGROUP, CUSTOMER, CUSTOMERGROUP.autoFocussortTypeString – ASC or DESC. Applicable to MULTITIERENTRY input type only. validationTypeString – VALIDATE or NO_VALIDATION. Applicable to MULTITIERENTRY input type only. hideAddButtonBoolean – Set to trueto hide the "Add" button, including the "Duplicate” icon displayed next to each item. Applicable to INPUTMATRIX input type only.hideRemoveButtonBoolean – Set to trueto hide the "Remove" button. Applicable to INPUTMATRIX input type only.canModifyRowsBoolean – Set to falseto hide "Add" and "Remove" buttons. Applicable to INPUTMATRIX input type only.readOnlyColumnsSpecifies columns (as a list) that are set as read only. Applicable to INPUTMATRIX input type only. noCellRefreshBoolean – Prevents the Configurator refresh when the value of the Input Matrix cell is edited. Applicable to INPUTMATRIX input type only. defaultHeightNumber that defines the maximum Input Matrix table height. If there are more entries than the defined default height the scroll bar appears. Applicable to INPUTMATRIX input type only. fixTableHeightBoolean that sets the fixed height of the table. Default: true. Applicable to INPUTMATRIX input type within the Configurator only. "enableClientFilter" Allows a user to filter the table by row values. Default: true (the filtering is enabled). Example: cp.setConfigParameter("enableClientFilter", false). Applicable to
InputType.INPUTMATRIXandInputType.CONFIGURATORTABLEinputs type only."enableAdvancedFilter" Allows a user to filter the table by advance filters. Default: false (the filtering is disabled). Example: cp.setConfigParameter("enableAdvancedFilter", false). Applicable to
InputType.INPUTMATRIXandInputType.CONFIGURATORTABLEinputs type only.hiddenColumnsSpecifies table columns (as a list) that are hidden from the user interface. Applicable to INPUTMATRIX input type within the Configurator only. columnValueOptionsSpecifies options for the drop-down menu for the Option column type. Example: cp.setConfigParameter("columnValueOptions", ["column1" : ["Team Leader","Technical Expert","Observer","Member","Critic"]]). Applicable to INPUTMATRIX input type only.columnTypeSets types for the table columns. Example: cp.setConfigParameter("columnType", ["Option","Numeric","Text","Date"]). Applicable to INPUTMATRIX input type only.disableRowSelectionSet to trueto disable the row selection (to hide the check-box). Applicable to INPUTMATRIX input type only.columnLabelsSets column labels. Example: cp.setConfigParameter("columnLabels", ["First Column", "Second Column"])Applicable to INPUTMATRIX input type only.requiredColumnsSets columns a required. Example: cp.setConfigParameter("requiredColumns", ["col1", "col2"])Applicable to INPUTMATRIX input type only."enableInputValueTracking_Previous" Sets the input to previous value trackable. Example: cp.setConfigParameter("enableInputValueTracking_Previous", true).
"enableInputValueTracking_Default" Sets the input to default value trackable. Example: cp.setConfigParameter("enableInputValueTracking_Default", true).
"enableInputValueTracking_ValueChangedByLogic" Sets the input to value change-by-groovy-logic trackable. Example: cp.setConfigParameter("enableInputValueTracking_ValueChangedByLogic", true).
"enableAddActions" turn on/off the ability to add rows in the table (turn on by the default). Example: cp.setConfigParameter("enableAddActions", false).
"preferenceName" set the preference name. Example: cp.setConfigParameter("preferenceName", 'somePreferenceName').
"maxLength" set the maximum length of an input (without validation) for StringUserEntryandTextUserEntry.Example: cp.setConfigParameter("maxLength", 4).
"minLength" set the minimum length of an input (without validation) for StringUserEntryandTextUserEntry.Example: cp.setConfigParameter("minLength", 2).
- Parameters:
paramName-value-- Returns:
-
clearConfigParameter
-
getFormattingOptions
-
setFormattingOptions
Allows you to set desired formatting options of the input field as a map. For setting a particular formatting option seesetFormattingOption(String, Object).- Parameters:
formattingOptions-- See Also:
-
isStoreAuditTrail
-
setStoreAuditTrail
-
isLogActivity
-
setLogActivity
-
setFormattingOption
Sets (adds or updates) a formatting option (how the input field is displayed) within the formattingOptions map.Example – creates an input field and sets the placeholder:
Possible values of thedef ce = api.createConfiguratorEntry() cp = ce.createParameter(InputType.STRINGUSERENTRY, "stringInputField") cp.setLabel("String Input Field") cp.setFormattingOption("placeholder","I hold the place")optionNameparameter:optionName Description placeholderSee setPlaceholderText()for more details.defaultWidthSee setDefaultWidth()for more details.widthSee setWidth()for more details.titleSee setTitle()for more details.helpTextSee setHelpText()for more details.helpLinkSee setHelpLink()for more details.customAttributeNameSee setCustomAttributeName()for more details.customAttributeValueSee setCustomAttributeValue()for more details.flexSee setFlex()for more details.- Parameters:
optionName- See the table above.value-- Returns:
-
getAddUnknownValues
-
setAddUnknownValues
-
getTypedId
-
setTypedId
-
getAlwaysEditable
-
setAlwaysEditable
-
addInput
Adds a nested input. This input can be of any type. This is intended to be used when the parent input is of type @link InputType#ROW} or typeInputType.COLLAPSE. Depending on the parent type, it is also expected that the added input will have a flex attribute.- Parameters:
contextParameter- the input to add
-
getInputs
-
toString
-
setIfNotNull
Copy attributes from the originalContextParameterapart from:name,lookupTableId,type,inputsandvalueHint- Parameters:
original-ContextParameteras a source for the attributes' copy if not null
-
copyWithoutValue
-
update
-
getObjectService
public PersistedObjectService getObjectService() -
equals
-
hashCode
public int hashCode()
-