cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to set Text control from Odata service in SAPUI5 app

avisheksharmacoder
Participant
0 Kudos

Hi, I am doing a read operation and then trying to set the text of sap.m.Text control dynamically from Controller file. The read operation is triggered by the press of a Read button.

I am able to retrieve the data(from northwind service) but no luck setting the Text properly.

This is the Text control and Read Button.

this is controller code in a file.

fireread.txt

Do I need to use another method for this?

Thank you.

View Entire Topic
Dino
Explorer
0 Kudos

this is not defined in the success handler. you need to save it in a global var:
var that = this;
....

success:

....
that.getView().byId("t1").setText(textData);

....

avisheksharmacoder
Participant
0 Kudos

Thanks worked perfectly.