Versions Compared

Key

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

...

To restrict the user to picking a single alternative in a drop-down list, use the option input.

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

formFieldSet.inputs = [
    api.inputBuilderFactory()
        .createOptionEntry('option').setOptions('A'..'E')
        .buildContextParameter()
]

return formFieldSet
Expand
titleIn input generation mode (input generation mode)
Code Block
languagegroovy
themeMidnight
linenumbersfalse
api.inputBuilderFactory()
        .createOptionEntry('option').setOptions('A'..'E')
        .getInput()
Expand
titleIn header Logics
Code Block
languagegroovy
themeMidnight
linenumbersfalse
processor.addOrUpdateInput(                 //❶
        'ROOT',
        api.inputBuilderFactory()
                .createOptionEntry('option').setOptions('A'..'E')
                .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.option as String

To allow the user to pick an arbitrary number of alternatives from a drop-down list, use the options entry.

Info
In the examples, note the s at the end of options. This is what distinguishes the multiple choice drop-down from the single-choice drop-down.
multipleImage Removed multipleImage Added
Expand
titleForms
Code Block
languagegroovy
themeMidnight
linenumbersfalse
def formFieldSet = api.createConfiguratorEntry()

formFieldSet.inputs = [
    api.inputBuilderFactory()
        .createOptionsEntry('options').setOptions('A'..'E')
        .buildContextParameter()
]

return formFieldSet
Expand
titleIn input generation mode (input generation mode)
Code Block
languagegroovy
themeMidnight
linenumbersfalse
api.inputBuilderFactory()
        .createOptionsEntry('options', ).setOptions('A'..'E')
        .getInput()
Expand
titleIn header Logics
Code Block
languagegroovy
themeMidnight
linenumbersfalse
processor.addOrUpdateInput(                 //❶
        'ROOT',
        api.inputBuilderFactory()
                .createOptionsEntry('options').setOptions('A'..'E')
                .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.options as List<String>

...