NumericFormElement
A NumericFormElement writes an <input> element with a type="text" to the output.
It uses the JQuery autoNumeric plugin to support decimal precision, localization and adding symbols (eg. for currency).
Element and builder
The ViewElement implementation is NumericFormElement and has an equivalent NumericFormElementBuilder.
A builder can be created using BootstrapViewElements.bootstrap.builders.numeric() factory methods.
NumericFormElement attributes
| Attribute | Description | Default |
|---|---|---|
|
See |
Not set by default |
Examples
Creating a basic numeric form element
import static com.foreach.across.modules.bootstrapui.ui.factories.BootstrapViewElements.bootstrap;
bootstrap.builders.numeric()
.simple()
.build();
Creating an integer number form element
import static com.foreach.across.modules.bootstrapui.ui.factories.BootstrapViewElements.bootstrap;
bootstrap.builders.numeric()
.integer()
.build();
Creating a decimal number form element
import static com.foreach.across.modules.bootstrapui.ui.factories.BootstrapViewElements.bootstrap;
bootstrap.builders.numeric()
.decimal(2)
.build();