PL-10194 PivotTable unloads its content on Tab Change if ContentSwitchMode HIDE is set

This commit is contained in:
Daniil Tsarev 2017-12-26 10:02:52 +04:00
parent 22dcd74809
commit 93f0007850
2 changed files with 11 additions and 0 deletions

View File

@ -229,6 +229,9 @@ public interface Window extends Frame, Component.HasCaption, Component.HasIcon {
/**
* Sets how the managed main TabSheet switches a tab with this window: hides or unloads its content.
* <p>
* Note that: a method invocation will take effect only if {@code cuba.web.mainTabSheetMode} property
* is set to 'MANAGED'.
*
* @param mode one of the {@link ContentSwitchMode} enum values
*/

View File

@ -49,6 +49,7 @@ import com.haulmont.cuba.web.gui.components.WebFrameActionsHolder;
import com.haulmont.cuba.web.gui.components.WebWrapperUtils;
import com.haulmont.cuba.web.toolkit.ui.CubaSingleModeContainer;
import com.haulmont.cuba.web.toolkit.ui.CubaVerticalActionsLayout;
import com.haulmont.cuba.web.toolkit.ui.MainTabSheetMode;
import com.vaadin.server.ClientConnector;
import com.vaadin.server.Page;
import com.vaadin.server.Sizeable.Unit;
@ -1418,6 +1419,13 @@ public class WebWindow implements Window, Component.Wrapper,
Preconditions.checkNotNullArgument(mode, "Content switch mode can't be null. " +
"Use ContentSwitchMode.DEFAULT option instead");
MainTabSheetMode tabSheetMode = AppBeans.get(Configuration.class)
.getConfig(WebConfig.class)
.getMainTabSheetMode();
if (tabSheetMode != MainTabSheetMode.MANAGED) {
log.debug("Content switch mode can be set only for the managed main TabSheet. Current invocation will be ignored.");
}
this.contentSwitchMode = mode;
}