为什么我会在DataReceived事件上获得oevent.getParameter(data')?

发布于 2025-02-04 08:19:00 字数 627 浏览 1 评论 0原文

this.getView().bindElement({
  path: `/Employees('${this._userId}')`,
  parameters: { expand: 'aaa,bbb,ccc' },
  events: {
    dataReceived: (oEvent) => {
      this.getView().setBusy(false)
      debugger
    }
  }
});

我可以在$ batch请求的响应中看到数据。 当我在datareceived函数处理程序中放置一个断点时,我还可以通过this.getView()。getModel()。getProperty(this.getView().getBindingContext())。 getPath())。 参数oevent.mparameters.data存在,但是该值是undefined

如果我忽略展开,则设置了数据。关联实体集的所有实体是否需要与其父母建立关联?

this.getView().bindElement({
  path: `/Employees('${this._userId}')`,
  parameters: { expand: 'aaa,bbb,ccc' },
  events: {
    dataReceived: (oEvent) => {
      this.getView().setBusy(false)
      debugger
    }
  }
});

I can see data in the response of the $batch request.
When I put a breakpoint in the dataReceived function handler, I can also see the data via this.getView().getModel().getProperty(this.getView().getBindingContext().getPath()).
The parameter oEvent.mParameters.data exists, but the value is undefined.

If I leave out expand, the data is set. Do all entities of an associated entityset need to have an association to its parent?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

指尖微凉心微凉 2025-02-11 08:19:00

This is by design according to the API reference of dataReceived

datareceived

[...]此事件也可能会发出错误时

paramtype描述
data字符串接收到的数据; 错误情况中的未定义

您必须在$ batch响应中有一个错误消息,否则请求以某种方式中止了。

缺少数据参数当前是bindobject上的失败请求的唯一记录指标/bindelement


PS:另请参阅 https://github.com/sap/sap/sap/openui5/issues/2263

This is by design according to the API reference of dataReceived:

dataReceived

[...] This event may also be fired when an error occurred.

Paramtypedescription
datastringThe data received; is undefined in error cases

You must have somewhere an error message in the $batch response, or the request was somehow aborted.

The missing data parameter is currently the only documented indicator for a failed request on bindObject/bindElement.


PS: See also https://github.com/SAP/openui5/issues/2263

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文