on 06-21-2019 12:09 PM
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");
}
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
If you want to handle the event for the aggregation menu, use the menu event itemSelected or individual menu item events.
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.