Field component that allows stepping through values via given up/down controls.
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.
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);
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.
- fixed critical bug when there was only a min/max limit, not both (thanks Guy DS)
- fixed a couple of size bugs many users reported, now all sizes should be supported
- added support for read-only and disabled states
- enhanced how min/max limits work
- Apache License 2.0
- Vaadin 6.6+
- Vaadin 6.3+ in 0.5
- Vaadin 6.2+ in 0.1
- Vaadin 6.7+ in 1.2.0
- Vaadin 7.0+ in 2.0
- Vaadin 7.4+ in 2.2.2
- Vaadin 7.6+ in 2.3.0
- Vaadin 8.0+ in 2.4.0
- Vaadin 7.7+ in 2.3.1
- Internet Explorer
- Internet Explorer
- Google Chrome