为什么onBeforeFirstShow有效? [英] Why does onBeforeFirstShow work?

查看:156
本文介绍了为什么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有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆