on ‎2021 Jan 21 12:54 PM
Dear experts,
I am using SAP CAP model to develop an application with Business Application Studio. I have CDS defined and data is being published as oDatav4 format.
This is my manifest.json file. Also default model is defined
"dataSources": {
"mainService": {
"uri": "/srv-api/rooms/",
"type": "OData",
"settings": {
"odataVersion": "4.0"
}
}
}
.
.
.
"models": {
"": {
"dataSource": "mainService",
"preload": true,
"settings": {
"operationMode": "Server",
"groupId": "$direct",
"synchronizationMode": "None",
"autoExpandSelect": true
}
}
},
This is also my CDS odata

and here is my view.
<Table
id="productsTable"
inset="false"
items="{
path: '/Rooms'
}"
class="sapFDynamicPageAlignContent"
width="auto">
<columns>
<Column width="12em">
<Text text="Office Area"/>
</Column>
<Column hAlign="End">
<Text text="Availability"/>
</Column>
</columns>
<items>
<ColumnListItem type="Navigation" press=".onListItemPress">
<cells>
<ObjectIdentifier title="{roomName}" text="{roomCountry} - {roomCity}"/>
<ObjectNumber
unit="{roomSeatNumber}"/>
</cells>
</ColumnListItem>
</items>
</Table>
Could you tell me where I am making a mistake while binding data in XML view? There is no data being transferred to view with this method. I am sure I am making some newbie mistake somewhere but still I'm not able to figure out.
I know that oDatav4 is not supporting direct access and i dont want to use jQuery/ajax get method to bind my data to view.
Thank you in advance.
Regards,
Erkan
Request clarification before answering.
hi, I figured out that I have to bind oData service in my controller too.
Also there is no error log, basically it was not bound through manifest.json only.
Followed oData v4 documentation for solution:
https://sapui5.hana.ondemand.com/#/topic/5de13cf4dd1f4a3480f7e2eaaee3f5b8
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks fine on first sight. Do you see any error in the console log? Do you see the request for Rooms in the network trace?
Maybe this blog post and demo app can help you https://blogs.sap.com/2020/11/06/ui5ers-buzz-56-new-full-stack-ui5-sample-app-featuring-cap-odata-v4...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 11 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.