Directory

← Back

Stepper

Field component that allows stepping through values via given up/down controls.

Author

Contributors

Rating

TextField that allows stepping through values via given up/down controls. It currently supports the following features:

  • Integer, BigDecimal, Float and Date values
  • The step amount can be configured
  • Maximum and minimum values can be configured
  • Supports null values
  • Keyboard stepping with up / down keys
  • Mousewheel support
  • For the float stepper, the decimal accuracy can be configured.
  • For the float and BigDecimal steppers, the decimal format can be configured
  • For the date stepper, date, month or year stepping can be specified
  • Allows setting "invalid" values for server-side validation
  • Manual input can be disabled completely so only the controls can be used to change the value
  • Client-side filtering disallows the user from entering invalid values to the IntStepper and FloatStepper

Note: The float version is somewhat inaccurate by design. It should however be enough for most use cases. When using the declarative format (e.g. Designer) the DateStepper fields don't support the full accuracy of Date.

Sample code

        IntStepper intStepper = new IntStepper();
        intStepper.setValue(1);
        intStepper.setStepAmount(1);

        FloatStepper floatStepper = new FloatStepper();
        floatStepper.setValue(1.0f);
        floatStepper.setStepAmount(1.222f);
        floatStepper.setNumberOfDecimals(3);

        DateStepper dateStepper = new DateStepper();
        dateStepper.setValue(new Date());
        dateStepper.setStepField(VDateStepper.DateStepField.DAY);
        dateStepper.setStepAmount(1);

Links

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Vaadin 7 version with Java 7 compatible code. Not actively maintained.

Released
2018-01-10
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 7.7+
Vaadin 8.0+ in 2.4.0
Vaadin 7.6+ in 2.3.0
Vaadin 7.4+ in 2.2.2
Vaadin 7.0+ in 2.2.1
Vaadin 6.7+ in 1.2.0
Vaadin 6.6+ in 1.1.0
Vaadin 6.3+ in 0.5
Vaadin 6.2+ in 1.0.1
Browser
Firefox
Safari
Google Chrome
Internet Explorer
Microsoft Edge
Online