Update Table Problem in Tabsheet

Hello,

we are thinking about using Vaadin for a Enterprise solution. We’ve build the main application skeleton
and are testing the usability for our project.

The main application contains a menubar, which lays tabs on a tabsheet when a menu item is selected.
The listener of the menubar calls the lazy getters to get the components which are shown on the tabsheet.
That means if a component has been initialized yet, the application will re-use it.

This works fine, because when a user
clicks twice
or more on a menuitem the selected component is just
shown once
, as it has to be.
The tabs are
closable
and here comes the problem:

If the user closes the tab and reopen it, the data is shown as it was. In our case its a table with information from database.
I’ve implemented the TabSheet.CloseHandler to manipulate the component, so that it is initialized again (due to the lazy getter) to show correct data
from database. But it doesn’t.

Ive tried different ways:

@Override
public void onTabClose(TabSheet tabsheet, Component tabContent) {

   [b]

//get the tab and try to get rid of the components
[/b]
Tab currenttab = tabsheet.getTab(tabContent);
tabsheet.removeTab(currenttab);

   [b]

//remove the component
[/b]
tabsheet.removeComponent(tabContent);

    [b]

//set the component to null, so the lazy getter will initialize the component again
[/b]
tabContent = null;
}

Lazy getter looks like this:
private Component getComponent(){

 if(this.component == null){
           component = new Component();
 }

return this.component;

}

The thing is we’d like to avoid that a user opens a menu item (or the component which is behind the item) several times,
so that there could be a lot of tabs open in the same time.

Thanks in advance

Frederik

The data for the table is coming from the underlying Container-instance. Do you recreate that also?