on 2017 Oct 26 10:11 AM
Hi,
I want to change my page title, the value will be coming from Odata service.
I am trying with, title = "{ProjectData>Project_Name}",
but unable to get any data, header shows nothing.
It would be great help, if anyone suggest me with some other options, I am pretty new in Ui5.
Thanks In Advance.
Hi,
Here is an option how to do it (inside the views' controller)
onInit: function() {
var oModel = new JSONModel(...the place you get the OData from...);
this.getView().setModel(oModel);
oModel.attachRequestCompleted(function(oEvent) {
var oActiveModel = oEvent.getSource();
document.title = oActiveModel.getProperty('/ProjectData/0/Project_Name');
});
},
I am assuming the following JSON structure
"ProjectData":[{"Project_Name":"Title from OData"}]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.