Skip to Content

Get property from model

Hi all,

i got a model which was load in the component.js.

The model:

When I load the model in the controller.js is looks like:

As I want to insert a new entry I would like to read the property

	var oProperty = oModel.getProperty("/Nodes");

But oProperty is undefined if I use this. Waht am I doing wrong?

Many Thanks



capture.png (124.7 kB)
capture.png (41.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Feb 24, 2019 at 06:19 PM

    Hi Mario Mueller,

    Nodes.json is the file name and inside the file you have array of data. So the model is created and will be set with the data from that json model and it will not take the file name.

    var oArray = oModel.getProperty("/");

    You can also fetch the data like: oModel.getData()

    If your data is in the below format then your code will work..
    Nodes : [{..},{..}]


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 25, 2019 at 04:34 AM

    Hi Mahesh,

    great work!! Thanks a lot.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.