Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Decimal

Decimal input lets the end user type only decimal numbers.

decimalImage Removed decimalImage Added
Warning
The return type is not guaranteed to be of type BigDecimal. Therefore, always cast to BigDecimal when you read the input value:
Expand
titleForms
Code Block
languagegroovy
themeMidnight
linenumbersfalse
def formFieldSet = api.createConfiguratorEntry()

formFieldSet.inputs = [
    api.inputBuilderFactory()
        .createUserEntry('decimal')
        .buildContextParameter()
]

return formFieldSet
Expand
titleIn input generation mode (input generation mode)
Code Block
languagegroovy
themeMidnight
linenumbersfalse
api.inputBuilderFactory()
        .createUserEntry('decimal')
        .getInput()
Expand
titleIn header Logics
Code Block
languagegroovy
themeMidnight
linenumbersfalse
processor.addOrUpdateInput(                 //❶
        'ROOT',
        api.inputBuilderFactory()
                .createUserEntry('decimal')
                .buildMap()
)

❶ the processor can be one of the quoteProcessor, cProcessor, etc., which references subclasses of the CalculableLineItemCollectionBuilder

Expand
titleReading input value
Code Block
languagegroovy
themeMidnight
titleReading input value in a line-item logic.
linenumbersfalse
def value = input.decimal as BigDecimal

Integer

Integer input lets the end user type only integers.

integerImage Removed integerImage Added
Expand
titleForms
Code Block
languagegroovy
themeMidnight
linenumbersfalse
def formFieldSet = api.createConfiguratorEntry()

formFieldSet.inputs = [
    api.inputBuilderFactory()
        .createIntegerUserEntry('integer')
        .buildContextParameter()
]

return formFieldSet
Expand
titleIn input generation mode (input generation mode)
Code Block
languagegroovy
themeMidnight
linenumbersfalse
api.inputBuilderFactory()
        .createIntegerUserEntry('integer', )
        .getInput()
Expand
titleIn header Logics
Code Block
languagegroovy
themeMidnight
linenumbersfalse
processor.addOrUpdateInput(                 //❶
        'ROOT',
        api.inputBuilderFactory()
                .createIntegerUserEntry('integer')
                .buildMap()
)

❶ the processor can be one of the quoteProcessor, cProcessor, etc., which references subclasses of the CalculableLineItemCollectionBuilder

Expand
titleReading input value
Code Block
languagegroovy
themeMidnight
titleReading input value in a line-item logic.
linenumbersfalse
def value = input.integer as Integer

...