on 07-02-2017 7:58 AM
Hello Experts,
I am trying to run a SAPUI5 application that I wrote but I receive the following error:
sap.m.MenuButton is not a constructor
My code snippet:
var oBar = new sap.m.Bar({});
...
oBar.addContentLeft(new sap.m.MenuButton({tooltip: "{i18n>generic.Refresh}", press: function() { }, icon: "sap-icon://generic/refresh", buttonMode: "Split"}));
...
Any suggestions?
Regards.
Okay, I figured it out...
I was missing the following library declaration:
data-sap-ui-libs="..., sap.ui.unified, ..."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Effi,
Please check the sap.m.MenuButton documentation in the SAPUI5 Explored application:
Best regards
Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Frank,
Thank you for your answer.
I took the code that I wrote & put it in JS Bin. It is working.
...
var page = this.getView().byId("page");
page.setCustomHeader(new sap.m.Bar({
contentLeft: [
new sap.m.ToolbarSpacer(),
new sap.m.MenuButton({tooltip: "Test", press: function() { }, icon: "sap-icon://play", buttonMode: sap.m.MenuButtonMode.Split}),
new sap.m.Button({
text: "Next"
})
]
}));
...
For some reason, it does not work when I deploy it on my server (SAP Netweaver 7.5).
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.