I have a Page that has a sap.m.IconTabBar with 4 Tabs. Based on user input on a previous screen, I'd like to go to a specific tab. I have tried using the fireSelect event on the IconTabBar, which calls my handleTabSelect method. This dynamically loads the sap.ui.view and then adds the content to the item for the IconTab key that was selected.
//used to try and fire the select tab event var oIconTabBar = t.getView().byId("oIconTB"); oIconTabBar.fireSelect({ //trying to select the WIP tab dynamically without a user click key: "WIP", item: oIconTabBar.getItems()[0] }); oIconTabBar.setSelectedKey("WIP");
//handler for IconTab select event - fired in both cases, however doesn't show content unless the user physically clicks icontabbar handleTabSelect: function (evt) { var t = this; var key = evt.getParameter("key"); var item = evt.getParameter("item"); var oITB = t.getView().byId("oIconTB"); var view = new sap.ui.view({ id: "tabView" + key, viewName: "view.Draft" + key, type: "JS", viewData: { sPath: t._sPath, model: t.getView().getModel() } }); item.addContent(view); }
However, the content from the view is not loaded into the DOM. I have verified that the the view does return content and has the exact same object definition as if the user clicked on the IconTab for the selected key. The tab is actually selected on the Page but doesn't have any (attached screenshot)
If a user clicks on the tabs individually, the logic runs thru the exact same code (handleTabSelect) and works just fine.
Any ideas?