Notify an event to a compotite component

Hi People,

I’ a newbie of Vaadin, and I’m trying to make some workaround to fully understand the framework :*)

Now, the first problem is how to notify the ValueChangeListener made by Table Class to my object Grid.


package it.platform.UIComponent;

import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;

/**
 *
 * @author ale
 */
public class Grid extends CustomComponent
{
    public Grid(BeanItemContainer dataSource,Class classBean) {
         /* Create the table with a caption. */

        final VerticalLayout layout = new VerticalLayout();

        final Table table = new Table("This is my Table");

        table.setContainerDataSource(dataSource);

        /*
        table.setVisibleColumns(classBean..NATURAL_COL_ORDER);
        table.setColumnHeaders(ClienteBean.COL_HEADERS_ENGLISH);
         * 
         */

        // Allow selecting items from the table.
        table.setSelectable(true);

        
        // Shows feedback from selection.
        final Label current = new Label("Selected: -");
        
        
[b]
        // Handle selection change.
        table.addListener(new Property.ValueChangeListener() {

            public void valueChange(ValueChangeEvent event) {
                current.setValue("Selected: " + table.getValue());
            }
        });
[/b]
        // Send changes in selection immediately to server.
        table.setImmediate(true);
        table.setColumnReorderingAllowed(true);
        table.setColumnCollapsingAllowed(true);

        table.setSizeFull();

        layout.addComponent(table);
        layout.addComponent(current);

        setCompositionRoot(layout);
    }
}

My target is notify the event ValueChangeListner to Grid class and implements the code below
where I use the Grid object


        Grid grid = new Grid(.....)

        grid.addListener(new Property.ValueChangeListener() {

            public void valueChange(ValueChangeEvent event) {
                current.setValue("Selected: " + grid.getValue());
            }
        });

Is there any solution?