Skip to Content
1
Former Member
Aug 16, 2013 at 08:55 AM

Timing issue when accesssing data that was just bound

16 Views

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