Versions Compared

Key

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

...

Decimal

Decimal inputs only lets the end-user type decimal numbers.

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

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

return formFieldSet
Expand
titleIn header Logicsinput generation mode (syntax check mode)
Code Block
languagegroovy
themeMidnight
linenumbersfalse
processor.addOrUpdateInput(
        'ROOT',
        api.inputBuilderFactory()
       
        .createUserEntry('decimal')
     
          .buildMapgetInput()
)
Expand
titleIn forms (Configurators)header Logics
Code Block
languagegroovy
themeMidnight
linenumbersfalse
def formSection = api.createConfiguratorEntry()

formSection.setInputs([processor.addOrUpdateInput(
        'ROOT',
        api.inputBuilderFactory()
                .createUserEntry('decimal')
                .buildContextParameterbuildMap()
])

return formSection
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 inputs only lets the end-user provide integers:

integer
Expand
titleIn syntax check modeForms
Code Block
languagegroovy
themeMidnight
linenumbersfalse
def formFieldSet = api.createConfiguratorEntry()

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

return formFieldSet
Expand
titleIn header Logicsinput generation mode (syntax check mode)
Code Block
languagegroovy
themeMidnight
linenumbersfalse
processor.addOrUpdateInput(
        'ROOT',
        api.inputBuilderFactory()
       
        .createIntegerUserEntry('integer')
       , )
        .buildMapgetInput()
)
Expand
titleIn forms (Configurators)header Logics
Code Block
languagegroovy
themeMidnight
linenumbersfalse
def formSection = api.createConfiguratorEntry()

formSection.setInputs([processor.addOrUpdateInput(
        'ROOT',
        api.inputBuilderFactory()
                .createIntegerUserEntry('integer')
                .buildContextParameterbuildMap()
])

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

...