为什么onBeforeFirstShow有效?

编程入门 行业动态 更新时间:2024-10-28 03:18:18
本文介绍了为什么onBeforeFirstShow有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在学习主 - 详细演示,下面是的一个片段.Master.controller.js

I have been learning the master-detail demo, below is a snippet in Master.controller.js

onInit : function() { this.getView().addEventDelegate({ onBeforeFirstShow: function () { this.getOwnerComponent().oListSelector.setBoundMasterList(oList); }.bind(this) }); }

我无法理解该事件代理,因为我还没有看到 onBeforeFirstShow 事件在任何控件/视图API文档中。

I can not understand that event delegate because I haven't seen onBeforeFirstShow event is in any control/view API doc.

这是用户定义的事件还是预先定义的事件活动?

Is this is a just user-defined event or a pre-defined event?

我试过了

this.getView().addEventDelegate({ onBeforeFirstShow: function () { console.log("onBeforeFirstShow"); }.bind(this), onAfterRendering: function () { console.log("onAfterRendering"); }.bind(this) });

似乎它发生在 onAfterRendering 之前。此外:

It seems that it happens before onAfterRendering. Besides:

  • this.getView()。onAfterRendering 返回 function
  • this.getView()。onBeforeFirstShow 返回 undefined 。
  • this.getView().onAfterRendering returned function
  • this.getView().onBeforeFirstShow returned undefined.

我在 Controller 和查看,以及 sap.ui.core.mvc.Controller 和 sap.ui.core.mvc.View 。只有四种生命周期方法。

I have searched in doc of Controller and View, and source code of sap.ui.core.mvc.Controller and sap.ui.core.mvc.View. There are only four lifecycle methods.

推荐答案

事件 beforeFirstShow 可用对于视图,因为视图是 NavContainer 。除此之外,目前还有

The event beforeFirstShow is available for the view because the view is a direct aggregation child of NavContainer. Other than that, there are currently also

  • afterHide
  • afterShow
  • beforeHide
  • beforeShow
  • afterHide
  • afterShow
  • beforeHide
  • beforeShow

这些事件由 sap.m.NavContainer 。

Those events are triggered by sap.m.NavContainer on its child controls (in our case, the view) when navigation occurs and child controls are displayed/hidden.

更多推荐

为什么onBeforeFirstShow有效?

本文发布于:2023-10-16 22:10:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498869.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:onBeforeFirstShow

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!