Class SimpleInputBuilder<VT>
Builder class for basic input types.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractInputBuilder
AbstractInputBuilder.InputWidth
-
Field Summary
Fields inherited from class AbstractInputBuilder
builderContext, cp
-
Constructor Summary
ModifierConstructorDescriptionprotected
SimpleInputBuilder
(InputBuilderContext builderContext, String paramName, InputType inputType, String functionName) -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
setDataType
(String dataType) Sets the data type of the input field.
Possible values: text, float, integer, date, time, datetime, product, customersetDecimalPlaces
(String mode) N/A - the method has not been implemented in the user interface yet.setFormatType
(String formatType) Sets the format type of the input field.
Possible values: COMPLEX, DATE, DATETIME, INTEGER, LINK, MONEY, MONEY_CHF, MONEY_EUR, MONEY_GBP, MONEY_JPY, MONEY_PLN, MONEY_USD, NUMERIC, NUMERIC_LONG, PERCENT, SPARKLINE, TEXT
Example:Sets the minimum allowed value for the input field.Sets the minimum allowed date value for the input field.setInputType
(String inputType) Sets the input type of the field.
Example:N/A - the method has not been implemented in the user interface yet.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.as of 7.7.0, use insteadsetTo
setMaxLength
(Integer maxLen) N/A - the method has not been implemented in the user interface yet.Deprecated, for removal: This API element is subject to removal in a future version.as of 7.7.0, use insteadsetFrom
Deprecated, for removal: This API element is subject to removal in a future version.as of 7.7.0, use insteadsetFrom
setMinLength
(Integer minLen) N/A - the method has not been implemented in the user interface yet.setRichTextEditor
(boolean rte) N/A - the method has not been implemented in the user interface yet.setRounding
(boolean doRound) N/A - the method has not been implemented in the user interface yet.Sets the maximum allowed value for the input field.Sets the maximum allowed date value for the input field.Methods inherited from class AbstractInputBuilder
addOrUpdateInput, addToConfiguratorEntry, addToConfiguratorEntry, buildContextParameter, buildMap, getInput, self, setAccessCode, setAlign, setAlwaysEditable, setAppearance, setAutoComplete, setAutoFocus, setCaption, setConfigValues, setCustomAttributeName, setCustomAttributeValue, setDefaultWidth, setDisabled, setDisplayMode, setErrorMessage, setExportable, setFlex, setHelpLink, setHelpText, setIcon, setIconPosition, setImportable, setLabel, setLabelPlacement, setLabelStyle, setLabelTranslations, setLayoutGridName, setNoRefresh, setParameterGroup, setPlaceholderText, setReadOnly, setRequired, setShowInline, setSize, setSuccessMessage, setTheme, setTitle, setUserGroupEdit, setUserGroupView, setValue, setValueHint, setWarningMessage, setWidth
-
Constructor Details
-
SimpleInputBuilder
protected SimpleInputBuilder(InputBuilderContext builderContext, String paramName, InputType inputType, String functionName)
-
-
Method Details
-
setDataType
Sets the data type of the input field.
Possible values: text, float, integer, date, time, datetime, product, customerNote: Under standard circumstances, it is not necessary to set the data type using this method – the data type is set by the input builder used in your logic:
- createUserEntry() - float (BigDecimal) – Set the input as a range and define
from
andto
parameters using the setConfigParamater() method to allow a user to enter only a range of numbers. - createIntegerUserEntry() - integer
- createStringUserEntry() - text
- createDateTimeUserEntry() - datetime
- createDateUserEntry() - date
- createTimeUserEntry() - time
- createProductEntry - product
- createCustomerEntry - customer
def dateFormat = "yyyy-MM-dd" def maxDate = api.parseDate(dateFormat, "2021-10-17") def dateEntry = api.inputBuilderFactory() .createUserEntry("date") .setLabel("Date") .setPlaceholderText("date to 2021-10-17") .setDataType("date") .setFormatType(dateFormat) .setTo(maxDate) .buildContextParameter()
- Parameters:
dataType
- The type of the data.- Returns:
- self
- createUserEntry() - float (BigDecimal) – Set the input as a range and define
-
setFormatType
Sets the format type of the input field.
Possible values: COMPLEX, DATE, DATETIME, INTEGER, LINK, MONEY, MONEY_CHF, MONEY_EUR, MONEY_GBP, MONEY_JPY, MONEY_PLN, MONEY_USD, NUMERIC, NUMERIC_LONG, PERCENT, SPARKLINE, TEXT
Example:
To set the number of displayed decimals, use the following parameter (the number of zeros defines the number of decimal places displayed in the input field):def userEntry = api.inputBuilderFactory() .createUserEntry("Percentage") .setLabel("Percentage") .setPlaceholderText("Value between 35% and 60%") .setFormatType("PERCENT") .setFrom(0.35) .setTo(0.60)
.setFormatType("###.0000")
- Parameters:
formatType
- The format type (see possible values above).- Returns:
- self
- See Also:
-
setInputType
Sets the input type of the field.
Example:- Parameters:
inputType
- Type fo the input, ex. "range"- Returns:
- self
-
setRounding
N/A - the method has not been implemented in the user interface yet.- Parameters:
doRound
- The rounding mechanism turn on (true) or off (false)- Returns:
- self
-
setDecimalPlaces
N/A - the method has not been implemented in the user interface yet.- Parameters:
mode
- The decimal places of an element to display in the UI- Returns:
- self
-
setMax
Deprecated, for removal: This API element is subject to removal in a future version.as of 7.7.0, use insteadsetTo
Sets the maximum allowed value for the entry. The property set with this method is 'to'. Please notice that this method only accepts integer values, and no overloaded version of this method that accepts decimals exist. To use decimals, please use the replacement,setTo
.- Parameters:
max
- maximum value- Returns:
- self
-
setTo
Sets the maximum allowed value for the input field. When set, a user will not be able to select a higher value than specified by this method. The validation is performed only when the input field value is being entered by a user via the user interface.
Applicable to the following input types: INTEGERUSERENTRY, USERENTRY
Example:def userEntry = api.inputBuilderFactory() .createUserEntry("Percentage") .setLabel("Percentage") .setPlaceholderText("Value between 10% and 20%") .setFormatType("PERCENT") .setFrom(0.1) .setTo(0.2)
- Parameters:
to
- The maximum value.- Returns:
- self
- Since:
- 8.0 - Godfather
-
setMax
Deprecated, for removal: This API element is subject to removal in a future version.as of 7.7.0, use insteadsetTo
Sets the maximum allowed date value for the entry. The property set with this method is 'to'- Parameters:
max
- maximum date value- Returns:
- self
-
setTo
Sets the maximum allowed date value for the input field. When set, a user will not be able to enter (or select) a higher date than specified by this method. The validation is performed only when the input field value is being entered by a user via the user interface.
Use together withsetFrom(Date)
to specify the date range.Applicable to the following input types: DATETIMEUSERENTRY (accepts date limits only), DATEUSERENTRY
Example:def dateFormat = "yyyy-MM-dd" def maxDate = api.parseDate(dateFormat, "2021-10-17") def dateEntry = api.inputBuilderFactory() .createDateUserEntry("date") .setLabel("Date") .setPlaceholderText("date to 2021-10-17") .setFormatType(dateFormat) .setTo(maxDate)
- Parameters:
to
- The maximum date.- Returns:
- self
- Since:
- 8.0 - Godfather
-
setMaxLength
N/A - the method has not been implemented in the user interface yet.- Parameters:
maxLen
- The maximum length allowed for the input field.- Returns:
- self
-
setMin
Deprecated, for removal: This API element is subject to removal in a future version.as of 7.7.0, use insteadsetFrom
Sets the minimum allowed value for the entry. The property set with this method is 'from'. Please notice that this method only accepts integer values, and no overloaded version of this method that accepts decimals exist. To use decimals, please use the replacement,setFrom
.- Parameters:
min
- minimum value- Returns:
- self
-
setFrom
Sets the minimum allowed value for the input field. When set, a user will not be able to select a lower value than specified by this method. The validation is performed only when the input field value is being entered by a user via the user interface.
Applicable to the following input types: INTEGERUSERENTRY, USERENTRYExample:
def userEntry = api.inputBuilderFactory() .createUserEntry("Percentage") .setLabel("Percentage") .setPlaceholderText("Value between 10% and 20%") .setFormatType("PERCENT") .setFrom(0.1) .setTo(0.2)
- Parameters:
from
- The minimum value.- Returns:
- self
- Since:
- 8.0 - Godfather
-
setMin
Deprecated, for removal: This API element is subject to removal in a future version.as of 7.7.0, use insteadsetFrom
Sets the minimum allowed date value for the entry. The property set with this method is 'from'- Parameters:
min
- minimum date value- Returns:
- self
-
setFrom
Sets the minimum allowed date value for the input field. When set, a user will not be able to select a lower date than specified by this method. The validation is performed only when the input field value is being entered by a user via the user interface.
Use together withsetTo(Date)
to specify the date range.Applicable to the following input types: DATETIMEUSERENTRY (accepts date limits only), DATEUSERENTRY
Example:
def dateFormat = "yyyy-MM-dd" def minDate = api.parseDate(dateFormat, "2021-10-02") def dateEntry = api.inputBuilderFactory() .createDateUserEntry("date") .setLabel("Date") .setPlaceholderText("date from 2021-10-02") .setFormatType(dateFormat) .setFrom(minDate)
- Parameters:
from
- The minimum date.- Returns:
- self
- Since:
- 8.0 - Godfather
-
setMinLength
N/A - the method has not been implemented in the user interface yet.- Parameters:
minLen
- The minimum length allowed for the input field.- Returns:
- self
-
setList
N/A - the method has not been implemented in the user interface yet.- Parameters:
list
- To be defined- Returns:
- self
-
setRichTextEditor
N/A - the method has not been implemented in the user interface yet.- Parameters:
rte
- true for the usage of RichTextEditor- Returns:
- self
-
_getInput
- Specified by:
_getInput
in classAbstractInputBuilder<SimpleInputBuilder,
VT>
-
setTo