Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Table inside a tab - tabsheet reloads the whole content while switching bet

anto praveen fathima xavier
8 years ago Jul 12, 2014 5:43am

Hi,

I am using vaadin 7.1.10 and I am having table inside a tabsheet tab. At a time i create multiple tabs and execute different queries and it returns results on each of the tabs. when i switch between tabs i see the whole content getting reload/rerender as if it is loading for the first time. This gives a bad user experience.

In the tabsheet i have implement selectedTabChangeListener and have the below method

public void selectedTabChange(SelectedTabChangeEvent event) {
        //inside i just hide/show a layout nothing related to this table or tab
    }

I am not able to figure out if this is an issue with tabsheet or tab or anything else. could you please help?

regards
anto

Lukasz Byczynski
8 years ago Jul 12, 2014 10:06am
anto praveen fathima xavier
8 years ago Jul 13, 2014 4:58am
anto praveen fathima xavier
8 years ago Jul 14, 2014 3:11pm
anto praveen fathima xavier
8 years ago Jul 14, 2014 3:41pm
Lukasz Byczynski
8 years ago Jul 14, 2014 3:49pm
Henri Sara
8 years ago Jul 25, 2014 7:00am
Eduardo Frazão
6 years ago Dec 07, 2016 4:31pm

Henri Sara: In Vaadin 7, a TabSheet does keep only the visible tab contents in memory instead of trying to cache previously seen tabs like Vaadin 6 did. Otherwise, especially when using server push, updates would potentially need to be calculated and sent for all the tabs the user might have seen, which can have a performance impact both on the server and on the client. Caching them on the client can also have a big impact on client side memory usage, and the content of the other tabs may change completely in some applications based on what the user does on the current tab so the cache might not be valid anyway.

For Vaadin 6, there is an add-on DetachedTabs that takes an approach similar to what you did - a separate button bar themed like a tab bar to switch views. While there is no Vaadin 7 version of the add-on, the idea should be easy to copy. You could use some lazy rendering add-on if you want to pre-render all the tables so that the initial load time does not suffer too much.

Hi Henri. I know that this post is old, but I'm in trouble with this behavior of TabSheet. I need exactly the opposite, cache the client-side state because I have some client-side widgets that are very expensive to load, and I can't load it on every tab change. Is possible to hack this tabsheet behavior, to keep state at least for specific tables to avoid reload everything?