cuba icon indicating copy to clipboard operation
cuba copied to clipboard

Screen caption is not updated in AfterShow when mainTabSheetMode is managed

Open Flaurite opened this issue 2 years ago • 0 comments

Environment

  • Platform version: 7.2
  • Client type: Web

Description of the bug or enhancement

RU forum discussion: topic;

Steps to reproduce

  1. Add to the web properties: cuba.web.mainTabSheetMode = MANAGED
  2. In any screen subscribe to AfterShowEvent:
@Subscribe
public void onAfterShow(AfterShowEvent event) {
    getWindow().setCaption("New Caption");
}

AR Caption is no updated

Workaround:

@Subscribe
public void onAfterShow(AfterShowEvent event) {
    updateCaption();
}

protected void updateCaption() {
    com.vaadin.ui.Component parent = getWindow().unwrap(AbstractOrderedLayout.class);
    while (parent != null) {
        if (parent instanceof CubaManagedTabSheet.Tab) {
            ((CubaManagedTabSheet.Tab) parent).setCaption("New caption");
            break;
        }
        parent = parent.getParent();
    }
}

Flaurite avatar May 24 '22 06:05 Flaurite