cancel
Showing results for 
Search instead for 
Did you mean: 

sap.f.shellbar menu menuButtonPressed event not working

0 Kudos

Hi team,

I am trying to build a UI application and somehow not able to get the menuButtonPressed event to work for the ShellBar. Below is the code snippet of what I am trying to do - based on the API - any guidance will be of great help!

       <f:ShellBar title="Menu" homeIcon="" showSearch="true"
		showNotifications="true" showMenuButton="true"
		showProductSwitcher="true" notificationsNumber="2"
		menuButtonPressed="onMenuPress">
		<f:menu>
			<Menu>
				<MenuItem text="Heatmaps" icon="sap-icon://map" />
				<MenuItem text="Alerts" icon="sap-icon://alert" />
			</Menu>
		</f:menu>
		<f:profile>
			<f:Avatar initials="UI" />
		</f:profile>
	</f:ShellBar>

/////////////////////////////////////////////////////////////////////////
onMenuPress: function(oEvent) {
   //MessageToast.show(evt.getSource().getId() + " Pressed");
   alert("hell");
   MessageToast.show("Home icon pressed");
}

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor

showMenuButton shows a menu button on the left side and the menubuttonpress event is for that. But currently in the released pubic ui5 version, it is not working and a fix for that was done by sap on june 20th

GItHubLink

If you want to handle the event for the aggregation menu, use the menu event itemSelected or individual menu item events.

BR,

Mahesh

Thanks a lot Mahesh for the update. No wonder it wasn't working. I haven't checked this again, but is this update now available on the SAP UI5 library also now (or worst case, by when will this be updated to the SAP UI5 library from the OpenUI5 library?)

The Menu aggregator - I was able to get this to work, but was trying to check for the menuButtonPressed event.

maheshpalavalli
Active Contributor
0 Kudos

I am not sure George Abraham, it probably be released in next ui5 release but i don't think it will be a stable version.

Answers (0)