on 08-16-2013 9:55 AM
Hi,
in my createContent method, I bind a OdataModel to a dropdown triggered by a button click.
Right after the control.bindItems() method, I cant access a model property via e.g. control.getBindingContext("myModel").getProperty("prop"); null / undefined is returned.
This can be managed with setting attachRequestCompleted on the model (in the controller "onInit"), and access the property within this method. Another way would be to work with the setTimeout(function(){}) function (in the view "createContent") to access the property.
I was wondering, if it is possible to attach a similiar event like attachRequestCompleted on a control within the createContent method, to indicate that the data was loaded?
The setTimeout(function(){}) function is not reliable enough.
Regards
Stefan
Hi Stefan,
if it is really necessary to access a model property right after it has been read from the backend, I would recommend to stick to the attachRequestCompleted event. Depending on what you want to achieve,e.g. using the model property to display an icon , it might as well be possible to work with a formatter or make use of the type system.
Regards, Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
if you would like to "format" the data you read from the backend, you can use the https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/TypeSystem.html.
Regards, Frank
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.