Skip to Content

sap.f.shellbar menu menuButtonPressed event not working

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");
}
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jun 21, 2019 at 12:40 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.