Table of Contents

Input number

Live demo

Renders a integer or decimal input field.

Node name : input-number

Attributes

Bound

Attribute Type Required Default value Description
item UI view false @DatasourceCurrent Item to be bound to
property-name string true UI view property name

Unbound

Attribute Type Required Default value Description
alignment string (left, right, center) false right Horizontal alignment of the input value
disabled bool false false Value indicating whether the input is disabled
documentation string false Documentation
format string false Used to display the number being edited
label string false Input label.
placeholder string false Placeholder specifies a short hint that describes the expected value of an input field. The short hint is displayed in the input field before the user enters a value.
message-severity string (information, warning, error) false Severity of the message to display under the input
message-text string false Message to display under the input
max-value number false Maximum value. When the input value exceeds it, an error message is displayed under the input.
min-value number false Minimum value. When the input value is lower, an error message is displayed under the input.
readonly bool false false Value indicating whether the input is read-only.
required bool false false Value indicating whether the input is required.
tab-stop bool false true Value indicating whether the input can be focused using the Tab key.
value string true Input value.
value-changed string false Name of the method called when the value has changed. The first parameter is the value and the second is the current item of the data source (DatasourceCurrent) or the iterated item in a repeat component.

Common

Attribute Type Required Default value Description
focused bool false false Value indicating whether the component is focused.
label-position string (top, left, right, hidden) false top Input label position.
message-position string (bottom, hidden) false bottom Input message position.
step number false Sets the amount to add or subtract to the value property when the user clicks the spinner buttons.
type string (default, calculable) false default Allow mathématique when value is set to calculable.

Calculable only

Attribute Type Required Default value Description
enable-mask bool false true no input mask when typing
preview-mode-position string (hidden, left, top) false hidden preview position of the calculation result

Remarks

The format attribute accepts all .NET-style Standard Numeric Format Strings and provides support for scaling, prefixes, suffixes, and custom currency symbols.

Note

The .NET-style Custom Numeric Format Strings are not supported.

The following table describes some of the standard numeric format specifiers and displays sample output produced by each format specifier:

Format Description Examples
c A currency value. 123.456 ("C", en-US)-> $123.46
123.456 ("C", fr-FR)-> 123,46 €
123.456 ("C", ja-JP)-> ¥123
-123.456 ("C3", en-US)-> ($123.456)
-123.456 ("C3", fr-FR)-> -123,456 €
-123.456 ("C3", ja-JP)-> -¥123.456
n Integral and decimal digits, group separators, and a decimal separator with optional negative sign. 1234 ("N1", en-US) -> 1,234.0
1234.678 ("N3", en-US) -> 1,234.678
p Number multiplied by 100 and displayed with a percent symbol. 1 ("P", en-US)-> 100.00 %
1 ("P", fr-FR)-> 100,00 %
-0.39678 ("P1", en-US)-> -39.7 %
-0.39678 ("P1", fr-FR)-> -39,7 %

To enable Calculable mode for numeric cells in a Datagrid, either set input-number-type attribute to calculable or in the cluster configuration, set DatagridInputNumberType to calculable in UIDefaultBehavior section.

Examples

Bound

<input-number property-name="IntegerProperty" />
<input-number property-name="DecimalProperty" format="n3"/>

Unbound

<input-number value="@Fields.Value" label="myLabel" disabled="true" readonly="true" required="true" format="n0"/>