OptionsFormElementBuilder
To quickly create a list of options, either as a select, list of checkboxes or list or radio buttons.
Element and builder
The OptionsFormElementBuilder
builds an AbstractNodeViewElement
.
A builder can be created using BootstrapViewElements.bootstrap.builders.option.options()
factory methods.
This builder can be used to create a list of options.
The default implementation is a select
element which can be extended with a bootstrap-select
implementation.
OptionsFormElementBuilder attributes
Attribute | Description | Default |
---|---|---|
|
The type can be SELECT, RADIO or CHECKBOX |
SELECT by default |
|
Multiple options can be selected |
False by default |
|
Name of the element |
Not set by default |
|
Output radio elements |
Not set by default |
|
Output a select box |
Not set by default |
|
Output a checkbox |
Not set by default |
Examples
Creating an option list for a select field
import static com.foreach.across.modules.bootstrapui.ui.factories.BootstrapViewElements.bootstrap;
bootstrap.builders.option
.options()
.controlName( "demo" )
.add( bootstrap.builders.option.option().label( "Orange" ).value( "orange" ) )
.add( bootstrap.builders.option.option().label( "Apple" ).value( "apple" ) )
.build();