Hello,
I am trying to run a simple program where I set the Label in View and on the controller I am trying to change the label text. I am using the method sap.ui.core.byId() which is not working. This is not working even at the View.
Find below my code smapshot -
View -
var oText = new sap.ui.commons.TextView(this.createId("tv"), { text: "View Text" }); var oButton = new sap.ui.commons.Button(this.createId("button"), { text: "Click Me", press: function() {oController.click()} }); oText.placeAt("content"); oButton.placeAt("content");
Controller click function -
sap.ui.getCore().byId("tv").setText("Set in Controller");
When I use this.byId() and view.byId() this works but not on the sap.ui.getCore().byId(). Is there anything that I am doing incorrectly here?
Thanks,
Nagarajan.