numberField has many of the same features as textField, but it accepts only numeric input.

  • XML element: numberField

  • Java class: JmixNumberField


An example of numberField:

<numberField clearButtonVisible="true"
number field basics

Data Binding

You can bind a component to an entity and its attributes hold in a data container.

To bind numberField to an entity attribute:

  1. Specify the name of the data container as the dataContainer attribute value.

  2. Specify the name of the entity attribute as the property attribute value.

The entity attribute must be of Double, Integer or BigDecimal type.

    <instance class="" id="stepDc">
        <fetchPlan extends="_base"/>
        <loader id="stepDl"/>
    <numberField dataContainer="stepDc" property="factor"
                 step="0.5" stepButtonsVisible="true"/>
number field data binding


Чтобы сгенерировать заглушку обработчика в Jmix Studio, используйте вкладку Handlers панели инспектора Jmix UI, или команду Generate Handler, доступную на верхней панели контроллера экрана и через меню CodeGenerate (Alt+Insert / Cmd+N).


See Also

See the Vaadin Docs for more information.