checkbox setter binding failing

Hi,

I got an issue where upgrading from Vaadin version 6.4.10 to 6.6.0 breaks my application regarding the checkboxes binding.

The checkbox is not updating the object it is bound to, the setter is not called anymore, only the getter.

I created a small test app to demonstrate the issue. Under Vaadin 6.4.10 the application will work fine, under v 6.5.7 (or 6.6.0) the setActive will never be triggered when clicking the checkbox, unless I disable the setActive line:

    // setActive call will 'cripple' setter setActive under Vaadin 6.4.10 ???
    setActive(true);

Is this a new bug or is this related to backward incompatible changes?

package com.vaadinpoc.vaadinpoc;

import com.vaadin.Application;
import com.vaadin.data.util.MethodProperty;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Window;

/**

  • The Application’s “main” class.
    */
    public class MyVaadinApplication2 extends Application {
    private boolean active;
    private Window window;

    @Override
    public void init() {
    // setup window
    window = new Window(“My Vaadin Application2”);
    setMainWindow(window);

     // setup binding
     CheckBox checkbox = new CheckBox(null, new MethodProperty(this, "active"));
     window.addComponent(checkbox);
     checkbox.setImmediate(true);
     
     // setActive call will 'cripple' setter setActive under Vaadin 6.6.0 ???
     setActive(true);
    

    }

    public boolean isActive() {
    System.out.println("isActive called: " + active);
    return active;
    }

    public void setActive(boolean active) {
    System.out.println("setActive called: " + active);
    this.active = active;
    }
    }

Right. Tested and this is exactly as you reported! Really sounds like a nasty regression bug to me. Please report a bug at
dev.vaadin.com
. Do that, and I can provide you with a workaround :slight_smile:

Thanks! Here is the workaround: checkbox.setReadThrough(false);
Put that right after the setImmediate call. Thank you for reporting this.

Hi, your workaround works fine, thanks!