There was a problem - when navigating in the main window, tabs open in TabSet. and if you close the tab, you can open it again. the problem is that if the tab that extends VLayout is closed and opened again, the element refuses to be empty and in the console you can see that this layout simply does not have any content. Here is the class:
public class PrintWidget extends VLayout { private static PrintWidget instance = null; private static DataSource widgetData = null; private String widgetName = null; public static PrintWidget getInstance() { if (widgetData == null) { widgetData = ListData.getInstance(); } if (instance == null) { instance = new PrintWidget("PrintWidgetPresentation"); } return instance; } public PrintWidget(String widgetName) { this.widgetName = widgetName; SectionStack printStack = new SectionStack(); printStack.setVisibilityMode(VisibilityMode.MULTIPLE); printStack.setWidth(400); printStack.setHeight("85%"); final DetailViewer printViewer = new DetailViewer(); printViewer.setDataSource(widgetData); printViewer.setHeight("40%"); printViewer.setMargin(10); printViewer.setEmptyMessage("Выберете запись из списка для отображения деталей."); final ListGrid printGrid = new ListGrid(); printGrid.setDataSource(widgetData); printGrid.setHeight("60%"); printGrid.setAutoFetchData(true); printGrid.setGroupByField("bookAuthor"); ListGridField bookAuthorField = new ListGridField("bookAuthor", "Автор"); ListGridField bookTitleField = new ListGridField("bookTitle", "Название"); printGrid.setFields(bookAuthorField, bookTitleField); final SectionStackSection listDataSection = new SectionStackSection("Записи"); listDataSection.setExpanded(true); listDataSection.addItem(printGrid); printStack.addSection(listDataSection); final SectionStackSection detailsSection = new SectionStackSection("Детализированное представление записи"); detailsSection.setExpanded(false); VStack vStack = new VStack(); vStack.setOverflow(Overflow.AUTO); vStack.setWidth100(); vStack.addMember(printViewer); detailsSection.addItem(vStack); printStack.addSection(detailsSection); printGrid.addRecordClickHandler(new RecordClickHandler() { public void onRecordClick(RecordClickEvent event) { printViewer.setData(new Record[]{event.getRecord()}); detailsSection.setExpanded(true); } }); setHeight("85%"); addMembers(printGrid, printViewer); } And this is how a tab in TabSet is created
Tab newTab = new Tab(event.getNode().getTitle()); newTab.setID("PrintTab"); newTab.setCanClose(true); final PrintWidget printTabContent = PrintWidget.getInstance(); newTab.setPane(printTabContent); And this is how it is added to the main panel:
if (newTab != null) { tabsPane.addTab(newTab); tabsPane.selectTab(newTab); } else SC.say("К сожалению нет отображения, соответствующего этому элементу."); Help please understand what's the matter, why the content is not created when you call again?