0
当前UI5版本使用1.46.12获取列表|的第一个项目的值ODATA V4,SapUi5或OpenUi5
使用:sap.ui.model.odata.v4.ODataModel
需要什么?
是获取从oData(v4)响应接收到的列表数组的第一个项目的值“EventDate”。
查看代码
<layout:VerticalLayout binding="{/Logs}">
<Text text="Latest update"/>
<Text id="LastUpdatedSynchronizeDateStringText"
text="{EventDate}"/>
</layout>
批处理请求响应(ODATA V4)
{
"@odata.context":"http://localhost/odata/$metadata#Logs","value":[
{
"LogId":12512,"ErrText":"end","EventDate":"2017-05-11T07:10:44Z","Location":"OEN","Result":0
}
]
}
试过&失败:
<Text id="Last..." text="{EventDate}"/>
<Text id="Last..." text="{0/EventDate}"/>
<Text id="Last..." text="{0.EventDate}"/>
错误消息是 “无法向下钻取”
我正在使用oData v4 api,因此无法使用读取和创建调用,因为它们是用于odata v2。 https://openui5.hana.ondemand.com/#/topic/54e0ddf695af4a6c978472cecb01c64d –