Drop-Down List

A dropdown list lets the user pick one or several alternatives from a fixed set of alternatives.

Single Choice

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

single
Figure 1. A drop-down list for selecting a single alternative, rendered in the browser.
def formFieldSet = api.createConfiguratorEntry() formFieldSet.inputs = [ api.inputBuilderFactory() .createOptionEntry('option').setOptions('A'..'E') .buildContextParameter() ] return formFieldSet
api.inputBuilderFactory() .createOptionEntry('option').setOptions('A'..'E') .getInput()
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

Reading input value in a line-item logic

Multiple Choice

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

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.

multiple

Data Source Dimensions

A common use case is when the end user should select a value from a Data Source. For example, the user should be allowed to pick one of the years for which there is data.

DataSource.groovy

During Input Generation

Found an issue in documentation? Write to us.