cancel
Showing results for 
Search instead for 
Did you mean: 

Access complex JSON model with a model identifier

0 Kudos

Hello Experts,

i have a JSON model like the following.


{
"EmployeeID": 1,
"LastName": "Davolio",
"FirstName": "Nancy",
"Address": "507 - 20th Ave. E. Apt. 2A",
"City": "Seattle",
"Region": "WA",
"PostalCode": "98122",
"Country": "USA",
"HomePhone": "(206) 555-9857",
"ResumeID": 1,
"Resume" : {
"Information": "Information of Nancy Davolio",
"Projects": "Projects of Nancy Davolio",
"Hobbies": "Hobbies of Nancy Davolio",
"Notes": "Notes of Nancy Davolio"
}

}

i have loaded through the manifest file with an identifier "Employees". So now this should a named model.

i am trying to bind it to a list as follows.

<List
id="resumelistID"
items="{EmployeesEXT>Resume}"
headerText="Employee Resume">
<items>
<StandardListItem
title="{Information}"
description="{Resume>Projects}"
type="Navigation"
press="onResumeListPressEH">
</StandardListItem>
</items>
</List>

Resume is accessible with {EmployeesEXT>Resume}. But somehow i failed to bind values which inside "Resume" (Information, Projects, Hobbies,Notes).

i tried many combinations, like

{EmployeesEXT>Resume>Information},

{EmployeesEXT>Resume/Information}

{Resume>Information}

{Information}

i am really confused how to bind the resume data in the list.

i tried printing bindingContext in console. I got the perfect result. Resume data is bound to the list with sPath "0/Employees/Resume/Information". Somehow i am unable to display the values in the list.

Can anybody help me resolving my issue.

Thanks in advance for the help.

Accepted Solutions (0)

Answers (1)

Answers (1)

kammaje_cis
Active Contributor
0 Kudos
items="{EmployeesEXT>Resume}"

Above statement is wrong. This is because Resume is not an aggreagation/array.

Change json model like this.

"Resume" : [{"Information": "Information of Nancy Davolio","Projects": "Projects of Nancy Davolio","Hobbies": "Hobbies of Nancy Davolio","Notes": "Notes of Nancy Davolio"}]

And then

<StandardListItem title="{EmployeesEXT>Information}"description="{EmployeesEXT>Projects}"type="Navigation"press="onResumeListPressEH"> </StandardListItem>