on 09-28-2022 10:19 PM
Hello UI5 experts,
I have the ReferenceError that id ("Component1") is not defined.
But I thought I already define the id of the item.
items: [new sap.m.TabContainerItem("Component1", {
var Tab_xx = new sap.m.TabContainer("TabContainer", {
busy: true,
busyIndicatorDelay: 2000,
visible: true,
items: [new sap.m.TabContainerItem("Component1", { error occurred on this line
name: "All",
key: "All",
modified: false,
}), new sap.m.TabContainerItem("Component2", {
name: "Scube",
key: "Scube",
modified: false,
}), new sap.m.TabContainerItem("Component3", {
name: "Non Scubes",
key: "Non Scubes",
modified: false,
})],
itemSelect: function(oControlEvent) {
var sId = oControlEvent.getSource().getId();
if(sId === Component1) {
alert("Hello");
} else if (sId === Component2) {
alert("Goodbye");
}
}
});
Do you have any idea why it happened?
Best regards,
Nikita
you didn't mention which line throws error.
i guess you need to use sap.ui.getCore().byId("ComponentScube1") to get reference to that control.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.