Timing for fire ValueChangeListener in table cell ?

I need to detect table cell data change.
so I add valueChangeListener at field like

[code]
CheckBox cb = (CheckBox)field;

            cb.setImmediate(true);
            cb.addValueChangeListener(new ValueChangeListener(){

                @Override
                public void valueChange(ValueChangeEvent event) {
                    // TODO Auto-generated method stub
                    CheckBox source = (CheckBox) event.getProperty();
                    System.out.println("new:"+event.getProperty().getValue());                        
                }
                
            });

[/code]but the event got fire not suitable.
when table row change the vaueChangeEvent got fire ?
It’s not good ,because I just can not to judge the evnet is for change row or change value ?
Maybe I am wrong . but someone can tell me the right method.
Thank’s a lot !

ValueChangeEvent event is fired for all Field components, for your table as well your CheckBox. You dont need to judge anything. If its the row-selection that is changing then the ValueChangeEvent of the table will be fired, if its the CheckBox value (true to false, false to true) that is changing, then the ValueChangeEvent of the CheckBox will be fired.

but My question is when the row-changed then the table and checkBox 's valueChangeEvent fired both.
My hope is like you say. but it’s not.
You should try it.

Now I find a surprising method to solve it.
If someone have this problem too,could try it.(not sure it’s right.)

                CheckBox cb = (CheckBox)field;
   
                cb.setImmediate(true);
                cb.addValueChangeListener(new ValueChangeListener(){
                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        // TODO Auto-generated method stub
                          
                        CheckBox source = (CheckBox) event.getProperty();
                             if(source.getParent!=null){
                                    System.out.println("new:"+event.getProperty().getValue());
                             }
                    
                });

Hmm, didn’t have any problems with both values firing off.

Running the latest Vaadin version, with the following test code:

@Override
protected void init(VaadinRequest request) {
  final VerticalLayout layout = new VerticalLayout();
  setContent(layout);

  Table table = new Table();
  table.setSelectable(true);
  table.addContainerProperty("Akak", Label.class, null);
  table.addContainerProperty("Kaka", CheckBox.class, null);
  table.addValueChangeListener(new ValueChangeListener() {
    @Override
    public void valueChange(ValueChangeEvent event) {
      System.out.println("Table value change");
    }
  });

  CheckBox cb1 = new CheckBox("Lamlam");
  cb1.addValueChangeListener(new ValueChangeListener() {
    @Override
    public void valueChange(ValueChangeEvent event) {
      System.out.println("Checkbox 1 value change");
    }
  });

  CheckBox cb2 = new CheckBox("Malmal");
  cb2.addValueChangeListener(new ValueChangeListener() {
    @Override
    public void valueChange(ValueChangeEvent event) {
      System.out.println("Checkbox 2 value change");
    }
  });

  table.addItem(new Object[] { new Label("Bambam"), cb1 }, 1);
  table.addItem(new Object[] { new Label("Mabmab"), cb2 }, 2);
  
  layout.addComponents(table);
}