on ‎2018 Aug 16 3:45 PM
Hi Experts,
I have a nested JSON model named salesOrderModel as below and I am trying to bind it to a list in a XML view to display all the product names in the "products" array.
{
"orders": [
{
"orderId": 0,
"orderName": "Order 1",
"products": [
{
"productId": 0,
"productName": "Product 1-A"
},
{
"productId": 1,
"productName": "Product 1-B"
},
{
"productId": 2,
"productName": "Product 1-C"
},
{
"productId": 3,
"productName": "Product 1-D"
},
{
"productId": 4,
"productName": "Product 1-F"
}
]
}
]
}
I am doing the binding in the XML view as below
<View
xmlns="sap.m"
xmlns:layout="sap.ui.layout"
controllerName="test.View1">
<Page
title="{salesOrderModel>orderName}"
navButtonPress="onNavBack"
showNavButton="{device>/system/phone}">
<content>
<List id="products"
items="{salesOrderModel>/orders}"
headerText="Products">
<items>
<StandardListItem title="{salesOrderModel>products/productName}"
type="Active"
press="onSelectionChange"/>
</items>
</List>
</content>
</Page>
</View>
The binding path at runtime is incorrect.

How can I correct the path and display the correct information? Thanks.
Regards,
Hui Bin
Request clarification before answering.
Hi Sergio Guerrero,
I tried exactly as you said but at runtime the path is invalid.

Any idea what's wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.