@@ -0,0 +1,1924 @@
+package com.itmill.toolkit.tests;%0A%0Aimport com.itmill.toolkit.ui.*;%0Aimport com.itmill.toolkit.ui.Button.ClickEvent;%0Aimport com.itmill.toolkit.ui.Button.ClickListener;%0A%0Apublic class TestSetVisibleAndCaching extends com.itmill.toolkit.Application %7B%0A%0A%09Panel panelA = new Panel(%22Panel A%22);%0A%09Panel panelB = new Panel(%22Panel B%22);%0A%09Panel panelC = new Panel(%22Panel C%22);%0A%0A%09Button buttonNextPanel = new Button(%22Show next panel%22);%0A%0A%09int selectedPanel = 0;%0A%0A%09public void init() %7B%0A%09%09Window mainWindow = new Window(%22TestSetVisibleAndCaching%22);%0A%09%09setMainWindow(mainWindow);%0A%0A%09%09panelA.addComponent(new Label(%0A%09%09%09%09%22AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%22));%0A%09%09panelB.addComponent(new Label(%0A%09%09%09%09%22BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB%22));%0A%09%09panelC.addComponent(new Label(%0A%09%09%09%09%22CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC%22));%0A%0A%09%09mainWindow.addComponent(new Label(%0A%09%09%09%09%22Inspect transfered data from server to %22%0A%09%09%09%09%09%09+ %22client and see how widgets are re-used,%22%0A%09%09%09%09%09%09+ %22 after each panel is once shown in GUI then%22%0A%09%09%09%09%09%09+ %22 their contents are not resend.%22));%0A%09%09mainWindow.addComponent(buttonNextPanel);%0A%09%09mainWindow.addComponent(panelA);%0A%09%09mainWindow.addComponent(panelB);%0A%09%09mainWindow.addComponent(panelC);%0A%0A%09%09selectPanel(selectedPanel);%0A%0A%09%09buttonNextPanel.addListener(new ClickListener() %7B%0A%09%09%09public void buttonClick(ClickEvent event) %7B%0A%09%09%09%09selectedPanel++;%0A%09%09%09%09if (selectedPanel %3E 2)%0A%09%09%09%09%09selectedPanel = 0;%0A%09%09%09%09selectPanel(selectedPanel);%0A%09%09%09%7D%0A%09%09%7D);%0A%0A%09%7D%0A%0A%09private void selectPanel(int selectedPanel) %7B%0A%09%09System.err.println(%22Selecting panel %22 + selectedPanel);%0A%09%09switch (selectedPanel) %7B%0A%09%09case 0:%0A%09%09%09panelA.setVisible(true);%0A%09%09%09panelB.setVisible(false);%0A%09%09%09panelC.setVisible(false);%0A%09%09%09break;%0A%09%09case 1:%0A%09%09%09panelA.setVisible(false);%0A%09%09%09panelB.setVisible(true);%0A%09%09%09panelC.setVisible(false);%0A%09%09%09break;%0A%09%09case 2:%0A%09%09%09panelA.setVisible(false);%0A%09%09%09panelB.setVisible(false);%0A%09%09%09panelC.setVisible(true);%0A%09%09%09break;%0A%09%09%7D%0A%09%7D%0A%7D%0A

Test that caching widgets works. Inspect transfered data from server to client and see how widgets are re-used after each panel is once shown in GUI then" their contents are not resend.