Class InputMatrixInputBuilder
InputType.INPUTMATRIX
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractInputBuilder
AbstractInputBuilder.InputWidth
-
Field Summary
Fields inherited from class AbstractInputBuilder
builderContext, cp
-
Constructor Summary
ConstructorDescriptionInputMatrixInputBuilder
(InputBuilderContext builderContext, String paramName) -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
setCanModifyRows
(boolean value) When set tofalse
a user will not be able to add or remove rows in the input matrix table.setColumns
(List<?> columns) setColumnValueOptions
(Map value) Sets column value options.setDefaultHeight
(int value) Sets the maximum input matrix table height.setDisableRowSelection
(boolean disableRowSelection) Manage the row selection visibilitysetEnableAdvancedFilter
(boolean enableAdvancedFilter) Enabling the advanced filter functionality.setEnableClientFilter
(boolean enableClientFilter) Allows a user to filter the table by row values.
Default =true
(the filtering is enabled).setFitFieldWidths
(boolean value) Sets whether fields (table cells) should autofit widths to title texts or the content.setFixTableHeight
(boolean value) Set totrue
to limit the input matrix table height by the DefaultHeight.setHiddenColumns
(List<String> columnsToHide) Allow for particular columns to be hidden in the input matrix table.setHideAddButton
(boolean value) Hides the "Add" button.setHideDeleteButton
(boolean value) Deprecated.setHideRemoveButton
(boolean value) Hides the "Remove" button.setNoCellRefresh
(boolean value) Set totrue
to display the Apply button within the input matrix.setReadOnlyColumns
(List<String> readOnlyColumns) Marks specified columns as read-only.setRequiredColumns
(List<String> requiredColumns) Sets columns as required.withEnableAdvancedFilter
(boolean enableAdvancedFilter) Enabling the advanced filter functionality.withEnableClientFilter
(boolean enableClientFilter) Allows a user to filter the table by row values.
Default =true
(the filtering is enabled).withPreferenceName
(String preferenceName) Defines the preference name (whitespace and non-alphanumeric will be dropped).Methods inherited from class AbstractInputBuilder
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
-
Constructor Details
-
InputMatrixInputBuilder
-
-
Method Details
-
setColumns
Method can be used to set column's name byList
or byList
ofMap
s.List
ofMap
argument allow to add columns with name, label and type.The column's
Map
structure is predefined:Keys allowed: 'columnName' (mandatory), 'columnLabel' (optional) and 'columnType' (optional).
There is no additional validation for 'columnType'. Keys are case-sensitive (ie. 'columnName' is not the same as 'columnNAME' and the second one will not be qualified).
Values allowed: no limitations, nulls and empty also allowed.
If 'columnName' is massing in the
Map
, theInputBuilderExceptions.MissingMandatoryColumnException
is thrownIf other than 'columnLabel' or 'columnType' key is passed in the
Map
, theInputBuilderExceptions.ColumnStructureException
is thrown.If null or empty collection is passed as the method's argument, the
InputBuilderExceptions.NullOrEmptyColumnsException
is thrownExample:
Whendef inputMatrix = api.inputBuilderFactory() .createInputMatrix('The Matrix') .setColumns([[columnName: 'Desc', columnLabel: 'Description', columnType: 'Text'], [columnName: 'Value', columnLabel: 'Numeric Value', columnType: 'Numeric']]) .buildMap() quoteProcessor.addOrUpdateInput(inputMatrix) return inputMatrix
List
ofString
s is passed as the argument only columns names are set.Example:
def im = api.inputBuilderFactory() .createInputMatrix("The Matrix") .setColumns(["column1", "column2"]) .buildMap() quoteProcessor.addOrUpdateInput(im) return im
-
setRequiredColumns
Sets columns as required. Example:def inputMatrix = api.inputBuilderFactory() .createInputMatrix('The Matrix') .setColumnsWithNameLabelType([[columnName: 'Desc', columnType: 'Text'], [columnName: 'Value', columnType: 'Numeric']]) .setRequiredColumns(['Value']) .buildMap() quoteProcessor.addOrUpdateInput(inputMatrix) return inputMatrix
- Parameters:
requiredColumns
- column's names collection, which need to be a part of the columns collection- Returns:
- The same instance of this class.
- Since:
- 12.1 - Clover Club
-
setDisableRowSelection
Manage the row selection visibilityExample:
def inputMatrix = api.inputBuilderFactory() .createInputMatrix("The Matrix") .setColumns(["column1", "column2"]) .setDisableRowSelection(false) .buildMap() quoteProcessor.addOrUpdateInput(inputMatrix) return inputMatrix
- Parameters:
disableRowSelection
- true for disabling the row selection (hide the check-box).- Returns:
- The same instance of this class.
- Since:
- 12.0 - Clover Club
-
setReadOnlyColumns
Marks specified columns as read-only. A user will not be able to change values in these columns.
Example – sets "column2" as read only:def im = api.inputBuilderFactory() .createInputMatrix("The Matrix") .setColumns(["column1", "column2"]) .setReadOnlyColumns(["column2"]) .buildMap() quoteProcessor.addOrUpdateInput(im) return im
- Parameters:
readOnlyColumns
- A list of strings that specifies columns to be marked as read-only.- Returns:
- self
-
setFitFieldWidths
Sets whether fields (table cells) should autofit widths to title texts or the content.
Example:def im = api.inputBuilderFactory() .createInputMatrix("The Matrix") .setColumns(["column1", "column2"]) .setFitFieldWidths(true) .buildMap() quoteProcessor.addOrUpdateInput(im) return im
- Parameters:
value
-true
to enable,false
to disable fit field width- Returns:
- self
- Since:
- 12.0 - Clover Club
-
setDefaultHeight
Sets the maximum input matrix table height. If there are more entries than the defined default height the scroll bar appears.
Example:def im = api.inputBuilderFactory() .createInputMatrix("The Matrix") .setColumns(["column1", "column2"]) .setDefaultHeight(300) .setFixTableHeight(true) .buildMap() quoteProcessor.addOrUpdateInput(im) return im
- Parameters:
value
- The maximum default height of the input matrix table.- Returns:
- self
- See Also:
-
setColumnValueOptions
Sets column value options. Allows a user to select one of the specified value only.
Example – defines "option1" and "option2" as the only available values the user can select from:def im = api.inputBuilderFactory() .createInputMatrix("The Matrix") .setColumns(["column1", "column2"]) .setColumnValueOptions([column1: ["option1", "option2"], column2: ["option1", "option2"]]) .buildMap() quoteProcessor.addOrUpdateInput(im) return im
- Parameters:
value
- The list of options for each column (a map of columnName:list of options).- Returns:
- self
-
setCanModifyRows
When set to
Example:false
a user will not be able to add or remove rows in the input matrix table.def im = api.inputBuilderFactory() .createInputMatrix("The Matrix") .setColumns(["column1", "column2"]) .setCanModifyRows(false) .buildMap() quoteProcessor.addOrUpdateInput(im) return im
- Parameters:
value
- true to enable, false to disable rows modification. Default = true.- Returns:
- self
-
setNoCellRefresh
Set totrue
to display the Apply button within the input matrix. A user can manually apply changes performed in the input matrix by clicking this button.Example:
def im = api.inputBuilderFactory() .createInputMatrix("The Matrix") .setColumns(["column1", "column2"]) .setNoCellRefresh(true) .buildMap() quoteProcessor.addOrUpdateInput(im) return im
- Parameters:
value
-true
to disable,false
to enable refreshing cells automatically. Default =false
.- Returns:
- self
-
setFixTableHeight
Set to
Example:true
to limit the input matrix table height by the DefaultHeight. The scroll bar appears within the input matrix when DefaultHeight is exceeded.def im = api.inputBuilderFactory() .createInputMatrix("The Matrix") .setColumns(["column1", "column2"]) .setDefaultHeight(150) .setFixTableHeight(false) .buildMap() quoteProcessor.addOrUpdateInput(im) return im
- Parameters:
value
-true
to enable,false
to disable fix table height. Default =true
.- Returns:
- self
- See Also:
-
setHiddenColumns
Allow for particular columns to be hidden in the input matrix table.If columns-to-be-hidden are not valid InputMatrix-config-options-column's name then nothing is set
Example:
if (api.isInputGenerationExecution()) return def inputMatrix1 = api.inputBuilderFactory() .createInputMatrix('Input matrix') .setColumns(['Key_1', 'Key_2', 'Key_3']) .setHiddenColumns(['Key_2']) .buildContextParameter() // Column with name 'Key_2' will be hidden in the InputMatrix table def inputMatrix2 = api.inputBuilderFactory() .createInputMatrix('Input matrix') .setColumns(['Key_1', 'Key_2', 'Key_3']) .setHiddenColumns(['Key_4']) .buildContextParameter() // Column with name 'Key_4' does not exist in the InputMatrix table, thus nothing be hidden or set
- Parameters:
columnsToHide
- List of columns' name to be hidden- Returns:
- self
- Since:
- 12.0 - Clover Club
-
setHideAddButton
Hides the "Add" button.Set to
Example – adds the input matrix and hides its "Add" button:true
to hide the "Add" button.return api.inputBuilderFactory() .createInputMatrix("InputMatrix") .setColumns(columns) .setColumnValueOptions(columnsValueOption) .setHideAddButton(true) .getInput()
- Parameters:
value
-true
to hide,false
to show the button.- Returns:
- self
- Since:
- 11.2.0 - Paper Plane
-
setHideDeleteButton
Deprecated.UsesetHideRemoveButton(boolean)
instead.Set to
Example – adds the input matrix:true
to hide the "Delete" button.return api.inputBuilderFactory() .createInputMatrix("InputMatrix") .setColumns(columns) .setColumnValueOptions(columnsValueOption) .setHideAddButton(true) .setHideDeleteButton(true) .getInput()
- Returns:
- self
-
setHideRemoveButton
Hides the "Remove" button.Set to
Example – adds the input matrix and hides its "Remove" button:true
to hide the "Remove" button.return api.inputBuilderFactory() .createInputMatrix("InputMatrix") .setColumns(columns) .setColumnValueOptions(columnsValueOption) .setHideRemoveButton(true) .getInput()
- Parameters:
value
-true
to hide,false
to show the button.- Returns:
- self
- Since:
- 11.2.0 - Paper Plane
-
withEnableClientFilter
Allows a user to filter the table by row values.
Default =true
(the filtering is enabled).Example:
return api.inputBuilderFactory() .createInputMatrix('InputMatrix') .setColumns(columns) .withEnableClientFilter(false) .buildContextParameter()
- Parameters:
enableClientFilter
- Set tofalse
to disable filtering.- Returns:
- the current instance of
InputMatrixInputBuilder
- Since:
- 13.0 - Rampur
- See Also:
-
setEnableClientFilter
Allows a user to filter the table by row values.
Default =true
(the filtering is enabled).Example:
return api.inputBuilderFactory() .createInputMatrix('InputMatrix') .setColumns(columns) .setColumnValueOptions(columnsValueOption) .setEnableClientFilter(false) .buildContextParameter()
- Parameters:
enableClientFilter
- Set tofalse
to disable filtering.- Returns:
- the current instance of
InputMatrixInputBuilder
- Since:
- 13.0 - Rampur
- See Also:
-
withEnableAdvancedFilter
Enabling the advanced filter functionality. Default =true
(the filtering is enabled).Example:
return api.inputBuilderFactory() .createInputMatrix("InputMatrix") .setColumns(columns) .withEnableAdvancedFilter(false) .buildContextParameter()
- Parameters:
enableAdvancedFilter
- Set tofalse
to disable filtering.- Returns:
- the current instance of
InputMatrixInputBuilder
- Since:
- 13.0 - Rampur
- See Also:
-
setEnableAdvancedFilter
Enabling the advanced filter functionality. Default =true
(the filtering is enabled).Example:
return api.inputBuilderFactory() .createInputMatrix('InputMatrix') .setColumns(columns) .setColumnValueOptions(columnsValueOption) .setEnableAdvancedFilter(false) .buildContextParameter()
- Parameters:
enableAdvancedFilter
- Set tofalse
to disable filtering.- Returns:
- the current instance of
InputMatrixInputBuilder
- Since:
- 13.0 - Rampur
- See Also:
-
withPreferenceName
Defines the preference name (whitespace and non-alphanumeric will be dropped).Example:
def contextParameter = api.inputBuilderFactory() .createInputMatrix('matrix') .withPreferenceName('someName') .buildContextParameter() contextParameter.getPreferenceName == 'someName'
- Parameters:
preferenceName
- name of the preference, cannot be whitespace or non-alphanumeric.- Returns:
- the current instance of
InputMatrixInputBuilder
- Since:
- 13.0 - Rampur
- See Also:
-
_getInput
- Specified by:
_getInput
in classAbstractInputBuilder<InputMatrixInputBuilder,
Object>
-
setHideRemoveButton(boolean)
instead.