Search in sources :

Example 1 with CubaTextField

use of com.haulmont.cuba.web.widgets.CubaTextField in project cuba by cuba-platform.

the class TestStepperField method setComposition.

@Override
protected void setComposition(CssLayout composition) {
    super.setComposition(composition);
    valueField = getInnerComponent("stepper_valueField");
    CubaTextField cubaTextField = valueField.unwrap(CubaTextField.class);
    cubaTextField.addShortcutListener(createAdjustmentShortcut(ShortcutAction.KeyCode.ARROW_UP, 1));
    cubaTextField.addShortcutListener(createAdjustmentShortcut(ShortcutAction.KeyCode.ARROW_DOWN, -1));
    upBtn = getInnerComponent("stepper_upBtn");
    downBtn = getInnerComponent("stepper_downBtn");
    upBtn.addClickListener(clickEvent -> updateValue(1));
    downBtn.addClickListener(clickEvent -> updateValue(-1));
}
Also used : CubaTextField(com.haulmont.cuba.web.widgets.CubaTextField)

Aggregations

CubaTextField (com.haulmont.cuba.web.widgets.CubaTextField)1