on 10-01-2015 8:28 AM
Hi All, I am trying to bind the elements with my json Object. Firstly i have created an Array of Object and set this object in this.getView() using: newArray.push({'startdate': '20-08-2015', 'end_date':'20-09-2015'}); var model = new JSONModel(); model.setData(customObject); this.getView().setModel(newArray,'project'); this.getView().bindElement('/project/0'); I am not able to bind the data object with my xml view. I think the problem is with model, when i am trying to console(this.getView().getModel()), it is giving me undefined. I am not able to find out where to set the model in the controller so that i can bind the object with xml. Regards, Harsh Jain
this.getView().setModel( new JSONModel(newArray),'project');
console.log(this.getView().getModel("project"));
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sai Vellanki, Thanks for the reply, I have tried this, but still not able to get the result 😞 I think, am not able to set the model to get the object. After setting the model when i am trying to get the Model, it showing "undefined". That's why the binding is not giving me the result. Regards, Harsh Jain
this.getView().setModel(model ,'project');
NOT
this.getView().setModel(newArray,'project');
and
should work after that
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.