tables problem

Hi everyone im verry new in Java an in Vaadin (my experience is in PHP) and y have a problem.
All he examples and the book are implemented with JPA and y cant useit because in my context because y cant conect to the database for jpa.
My specific problem is in a table, y try to add a roy and y cant doit, because the value of the getCont() changeit in the addClickListener but not in the context for the class so never add the row.
sorry for my english and thanks.

.

public class RellenarTablas extends CustomComponent {

protected int cont;

public RellenarTablas(Table integrantesTable, Table trabajoTable,
        Button AgregarIntegrantes) {
    // Show 5 rows
    // integrantesTable.setPageLength(5);
    // Define the names and data types of columns. The "default value"
    // parameter is meaningless here.
    // Table with a component column in non-editable mode
    integrantesTable.addContainerProperty("Legajo", ComboBox.class, null);
    integrantesTable.addContainerProperty("Nombre", ComboBox.class, null);
    integrantesTable.addContainerProperty("Categoría", ComboBox.class, null);
    integrantesTable.addContainerProperty("Escalafon", ComboBox.class, null);
    integrantesTable.addContainerProperty("Responsable", CheckBox.class, null);
    // Insert this data

    // Ejecuto la tarea Completar y Seguir
    AgregarIntegrantes.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            cont++;
            setCont(cont);
            System.out.println("Contador click" + getCont());
            
        }
    });

    System.out.println("Contador Actual" + getCont());
    integrantesTable.setImmediate(true);

    try {
        // Insert the data and the additional component column
        for (int i = 0; i < getCont(); i++) {
            ComboBox area = new ComboBox(null);
            ComboBox area1 = new ComboBox(null);
            ComboBox area2 = new ComboBox(null);
            ComboBox area3 = new ComboBox(null);

            // Relleno los Comboboxes con lo que traigo de la base.
            RellenarTablasCombos rel = new RellenarTablasCombos();
            rel.FillcomboLegajo(area, area1, area2, area3);

            // Add an item with four components
            Object obj[] = { area, area1, area2, area3, new CheckBox() };
            integrantesTable.addItem(obj, new Integer(i));
        }

    } catch (Exception e) {
        System.out.println("no funciona el rellenar tablas");
    }

    try {
        integrantesTable.setPageLength(integrantesTable.size());
    } catch (Exception e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
    // ---------------------------------------------------------------------------------------------------------

Are you trying to add a row each time the user clicks a button? In that case, you need to add some code to the button click listener to actually do that; now you just increment a number.

Thanks, I will try to do

Thanks it works with this code

package …

import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Notification;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextArea;

import model.RH_EmpleadoCopy;

public class RellenarTablas extends CustomComponent {

private int cont=1;

public RellenarTablas(final Table integrantesTable, Table trabajoTable,
        Button AgregarIntegrantes) {
    // Show 5 rows
    // integrantesTable.setPageLength(5);
    // Define the names and data types of columns. The "default value"
    // parameter is meaningless here.
    // Table with a component column in non-editable mode
    integrantesTable.addContainerProperty("Legajo", ComboBox.class, null);
    integrantesTable.addContainerProperty("Nombre", ComboBox.class, null);
    integrantesTable.addContainerProperty("Categoría", ComboBox.class, null);
    integrantesTable.addContainerProperty("Escalafon", ComboBox.class, null);
    integrantesTable.addContainerProperty("Responsable", CheckBox.class, null);
    // Insert this data
    System.out.println("Contador Actual" + getCont());

    // Ejecuto la tarea Completar y Seguir
    AgregarIntegrantes.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            cont++;
            setCont(cont);
            System.out.println("Contador click" + getCont());
            setintegrantetable(cont, integrantesTable);
        }
    });
    
    


public int getCont(){
    return cont;
}

public void setCont(int cont) {
    this.cont = cont;
}
private void setintegrantetable(int cont, Table integrantesTable){
    System.out.println("Contador Actual" + getCont());
    integrantesTable.setImmediate(true);

    try {
        // Insert the data and the additional component column
        for (int i = 0; i < cont; i++) {
            ComboBox area = new ComboBox(null);
            ComboBox area1 = new ComboBox(null);
            ComboBox area2 = new ComboBox(null);
            ComboBox area3 = new ComboBox(null);

            // Relleno los Comboboxes con lo que traigo de la base.
            RellenarTablasCombos rel = new RellenarTablasCombos();
            rel.FillcomboLegajo(area, area1, area2, area3);

            // Add an item with four components
            Object obj[] = { area, area1, area2, area3, new CheckBox() };
            integrantesTable.addItem(obj, new Integer(i));
        }

    } catch (Exception e) {
        System.out.println("no funciona el rellenar tablas");
    }

    try {
        integrantesTable.setPageLength(integrantesTable.size());
    } catch (Exception e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
}

}