SmartClient Version: v9.1p_2015-07-30/PowerEdition Deployment (built 2015-07-30)
I'm trying to add a FormItemClickHandler to the increase and decrease icons of a SpinnerItem. I tried to do something similar to the following code block but it doesn't seem to be working.
Window window = new Window();
window.setWidth(500);
SpinnerItem spinnerItem = new SpinnerItem();
DynamicForm form = new DynamicForm();
form.setFields(spinnerItem);
window.addItem(form);
spinnerItem.getIncreaseIcon().addFormItemClickHandler(new FormItemClickHandler() {
@Override
public void onFormItemClick(FormItemIconClickEvent formItemIconClickEvent) {
SC.say("Clicked");
}
});
window.show();
Alternatively, another solution to my problem is disabling the feature in SpinnerItem that automatically resets a value entered by the user when the value is outside of the defined min or max.
So my questions are,
- What is the correct way to add a click handler to the increase and decrease icons of a SpinnerItem?
- How do you disable the auto-reset of a SpinnerItem if the entered value is greater than the max or less than the min?
I'm trying to add a FormItemClickHandler to the increase and decrease icons of a SpinnerItem. I tried to do something similar to the following code block but it doesn't seem to be working.
Window window = new Window();
window.setWidth(500);
SpinnerItem spinnerItem = new SpinnerItem();
DynamicForm form = new DynamicForm();
form.setFields(spinnerItem);
window.addItem(form);
spinnerItem.getIncreaseIcon().addFormItemClickHandler(new FormItemClickHandler() {
@Override
public void onFormItemClick(FormItemIconClickEvent formItemIconClickEvent) {
SC.say("Clicked");
}
});
window.show();
Alternatively, another solution to my problem is disabling the feature in SpinnerItem that automatically resets a value entered by the user when the value is outside of the defined min or max.
So my questions are,
- What is the correct way to add a click handler to the increase and decrease icons of a SpinnerItem?
- How do you disable the auto-reset of a SpinnerItem if the entered value is greater than the max or less than the min?
Comment