on ‎2020 Jun 18 10:33 PM
I am trying to bind a nested array to the SAPUI5 table.
Json Model:
{
"Departments": [
{
"ID": "1",
"Name": "Oil and Gas",
"Employees": [
{
"ID": "12345",
"LastName": "Tom"
},
{
"ID": "678",
"LastName": "Jerry",
}
]
},
{
"ID": "2",
"Name": "Gasoline",
"Employees": [
{
"ID": "21",
"LastName": "Donald"
},
{
"ID": "22",
"LastName": "duck"
}
]
}
]
}
I am using SAPUI5 table:
<Table
items="{path:'oDataItem>/Departments/Employees'}"
width="auto"
fixedLayout="false"
mode="MultiSelect" >
<columns>
<Column width="auto">
<Text text="LastName of Employee" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Input editable="true" textAlign="Left" type="Text" change="onNameTextChange" width="15em" value="{path:'oDataItem>LastName'}" />
</cells>
</ColumnListItem>
</items>
</Table>
Above databinding path is not returning any data.
Can i fetch lastName by XML databinding? If yes, than how i fetch last name?
Thanks
Request clarification before answering.
I think you can use element binding and relative binding, no need to create different model.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 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.