integerField

integerField has many of the same features as textField, but it accepts only Integer input.

  • XML element: integerField

  • Java class: JmixIntegerField

Basics

An example of integerField:

<integerField id="integerField"
              clearButtonVisible="true"
              value="27000"/>
integer field basics

Data Binding

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

To bind integerField 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 Integer type.

<data>
    <instance class="com.company.onboarding.entity.Step" id="stepDc">
        <fetchPlan extends="_base"/>
        <loader id="stepDl"/>
    </instance>
</data>
<layout>
    <integerField dataContainer="stepDc"
                  property="duration"
                  step="1" stepButtonsVisible="true"
                  min="1" max="10"/>
</layout>
integer field data binding

Attributes

max

Specifies the maximum value of the field. Entering a value which is greater than max invalidates the field.

min

Specifies the minimum value of the field. Entering a value which is smaller than min invalidates the field.

step

Sets the allowed number intervals of the field. This specifies how much the value will be increased/decreased when clicking on the step buttons.

stepButtonsVisible

Sets the visibility of the buttons for increasing/decreasing the value accordingly to the default or specified step.

Handlers

To generate a handler stub in Jmix Studio, use the Handlers tab of the Jmix UI inspector panel or the Generate Handler action available in the top panel of the view class and through the CodeGenerate menu (Alt+Insert / Cmd+N).

Elements

See Also

See the Vaadin Docs for more information.