Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3548

Re: Read Entry Ui5 and bind to labels

$
0
0

Please use the following format when requesting data from an OData source:

 

oModel.read(

"/path",

{

  success: function(oData, response) {

    this.getView().byId("Categoryname").setText(response.data.CategoryName);

  }.bind(this),

  error: function(oError) {    

    this.getView().byId("txt").setText("test");

  }.bind(this)

});

 

Important parts are marked with bold:

- use an object as second parameter.

- Bind the 'this' object to the function, which will provide you access to the controller inside the method.

 

However, it would be better if you use data binding to access data from your XML view.

 

Regards,

Istvan


Viewing all articles
Browse latest Browse all 3548

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>