Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

JSONModel data from a file can not be read in view controllers onInit method

$
0
0

Hi,

 

In an other discussion I marked out a problem that makes me crazy!

I will post it here as a new question for clear discussion about this problem.

 

Now I have a test application with following scenario:

 

In my Component.js in method "init" I setup 2 identical models.

The first from code and the second from a .json file:

 

19-10-2015 16-46-18.jpg

This is my file:

 

19-10-2015 16-46-42.jpg

In my view controllers "onInit" method I want to read the data of the model (from .json file):

 

19-10-2015 16-49-46.jpg

But the result of getData() of the model created from .json file is empty!

But as you can see in the log the data is there in oModelTest02 .... I don't get it...

 

19-10-2015 16-39-56.jpg

I searched a lot now but can't find any solution for this problem!

Why am I not able to get access to the data from my file though the data is obviously there?!

 

I need the data to build some elements of my view dynamically (for example via loop and to calculate some things).

As long as I don't know an alternative for this procedure (any ideas?) I have to get this working.

 

 

Thanks and kind regards,

Dominik


Viewing all articles
Browse latest Browse all 3184

Trending Articles



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