Hi Team
We have a JSON file and I'm trying to bind it to my Page. But we don't see the values ,please correct me if some binding is missing here ?
createContent: function(controller){
var oModel = new sap.ui.model.json.JSONModel();
oModel.loadData("questions.json");
vardata=oModel.getData(); // Don't see any data during debugging !!
var page = new sap.m.Page({
title : "Page2",
value : "{/questions/name}",
navButtonTap : [ controller.onClick, controller ],
content: [
new sap.m.VBox(
items: [
new sap.m.Text({
id : Question',
text: "{/questions/name/1}",
}).addStyleClass('Question'),
...............
My Json will be like below (a very simple Quiz sample where I would like to present on the UI)
{ "questions": [ { "name": "Can you identify this color?", "description": "#ea4c89", "answers": [ { "name": "Dribbble", "description": "dribbble.png", "weight": 1 }, { "name": "Amazon", "description": "amazon.png", "weight": 0 }, { "name": "Apple", "description": "apple.png", "weight": 0 } ] },