public void _setToggleButtonTooltip(bool bSideExpanded) { sap.m.Button oToggleButton = this.byId <sap.m.Button>("sideNavigationToggleButton"); if (bSideExpanded) { oToggleButton.setTooltip("Large Size Navigation"); } else { oToggleButton.setTooltip("Small Size Navigation"); } }
/// <summary> /// Event handler for the notification button /// </summary> /// <param name="oEvent">the button press event</param> /// <param name="oData">not used</param> public void onNotificationPress([email protected] oEvent, object oData) { var oBundle = (jQuery.sap.util.ResourceBundle) this.getModel <sap.ui.model.resource.ResourceModel>("i18n").getResourceBundle(); // close message popover sap.m.MessagePopover oMessagePopover = this.byId <sap.m.MessagePopover>("errorMessagePopover"); if ((oMessagePopover != null) && oMessagePopover.isOpen()) { oMessagePopover.destroy(); } sap.m.Button oButton = new sap.m.Button(new sap.m.Button.Settings() { text = oBundle.getText("notificationButtonText"), press = (([email protected] oEvt, object data) => { sap.m.MessageToast.show("Show all Notifications was pressed"); }) }); sap.m.ResponsivePopover oNotificationPopover = new sap.m.ResponsivePopover(oView.createId("notificationMessagePopover"), new sap.m.ResponsivePopover.Settings() { title = oBundle.getText("notificationTitle"), contentWidth = "300px", endButton = oButton, placement = sap.m.PlacementType.Bottom, content = new [email protected]() { path = "alerts>/alerts/notifications", factory = this._createNotification }, afterClose = ([email protected] <sap.m.CloseInfo> ev, object data) => { ev.getSource().destroy(); } }); this.byId("app").addDependent(oNotificationPopover); // forward compact/cozy style into dialog jQuery.sap.syncStyleClass(oView.getController <AppController>().getOwnerComponent <Component>().getContentDensityClass(), oView, oNotificationPopover); oNotificationPopover.openBy(oEvent.getSource()); }