View Full Version : Checkbox handlers behavior

Dazzle Nsk
21 Jan 2019, 4:54 AM
In GXT 4.0.3 (and even in 4.0.4 January 21) it becomes impossible to add logic to checkbox to change value only when required and do not change value otherwise. Tried the following ways:

1. ChangeHandler for checkbox gives the opposite value for event for IE and Chrome. For example:

CheckBox checkBox = new CheckBox();
checkBox.addChangeHandler(event -> {
boolean newVal = ((CheckBox) event.getSource()).getValue();
//For IE newVal=false when checked first time, for Chrome it is true.

What is the purpose to make this method a part of CheckBox if it behaves differently for browsers?

2. If ValueChangeHandler used, works for Chrome, but not for IE.

checkBox.addValueChangeHandler(event -> {
//value is already changed there (to true)
if (logic when checkbox value should stay false) {
checkbox.setValue(false); or checkbox.setValue(false, false); keeps checkbox checked in IE
//show MessageBox to user about rules when it can be checked

How to make it work for IE?

3. & 4. were only tests trying to find a workaround.


checkBox.addHandler(new CheckChangedEvent.CheckChangedHandler() {
public void onCheckChanged(CheckChangedEvent checkChangedEvent) {
//never inside
}, CheckChangedEvent.getType());


available.addHandler(new BeforeCheckChangeEvent.BeforeCheckChangeHandler() {
public void onBeforeCheckChange(BeforeCheckChangeEvent beforeCheckChangeEvent) {
//never inside
}, BeforeCheckChangeEvent.getType());

19 Feb 2019, 1:53 PM
Hello there-

I apologize I do not have the answer to how to make this work. I have shared this with the support staff to look into. You may also report this through our support portal. We appreciate your patience with us.