The number inputs
...
let the user provide a number.
Decimal
Decimal
...
input lets the end
...
user type only decimal numbers.
...
Warning |
---|
The return type is not guaranteed to be of type BigDecimal. Therefore, always cast to BigDecimal when you read the input value: |
...
...
def formFieldSet = api.createConfiguratorEntry()
formFieldSet.inputs = [
api.inputBuilderFactory()
.createUserEntry('decimal')
.buildContextParameter()
]
return formFieldSet |
|
Expand |
---|
title | In input generation mode (input generation mode) |
---|
|
Code Block |
---|
| api.inputBuilderFactory()
.createUserEntry('decimal')
.getInput() |
|
...
| processor.addOrUpdateInput( //❶
'ROOT',
api.inputBuilderFactory()
.createUserEntry('decimal')
.buildMap()
) |
❶ the processor can be one of the quoteProcessor, cProcessor, etc., which references subclasses of the CalculableLineItemCollectionBuilder |
...
...
def value = input.decimal as BigDecimal |
|
Integer
Integer input lets the end user type only integers.
...
Expand |
---|
|
Code Block |
---|
| def formFieldSet = api.createConfiguratorEntry()
|
|
...
formFieldSet.inputs = [
api.inputBuilderFactory()
. |
|
...
...
integer')
.buildContextParameter()
] |
|
...
...
...
Code Block |
---|
language | groovy |
---|
theme | Midnight |
---|
title | Reading input value in a line-item logic. |
---|
linenumbers | false |
---|
|
def value = input.decimal as BigDecimal |
Integer
Integer inputs only lets the end-user provide integers:
...
In input generation mode (input generation mode) |
|
|
...
api.inputBuilderFactory()
.createIntegerUserEntry('integer', )
.getInput() |
|
...
...
processor.addOrUpdateInput( |
|
...
...
...
...
...
...
title | In forms (Configurators) |
---|
...
language | groovy |
---|
theme | Midnight |
---|
linenumbers | false |
---|
...
...
...
...
❶ the processor can be one of the quoteProcessor, cProcessor, etc., which references subclasses of the CalculableLineItemCollectionBuilder |
...
...
...
...
| def value = input.integer as Integer |
|
Minimum and Maximum Values
You can restrict the set of values that the end
...
user can provide to the input
...
by using the
...
setFrom()
and
...
setTo()
methods
...
.
...
api.inputBuilderFactory()
.createIntegerUserEntry('NaturalNumber')
. |
...
setFrom(1)
.setTo(100)
.getInput() |
...