天天看点

view controller lifecycle discussion - beforeRendering

Created by Jerry Wang on Aug 07, 2014

BeforeRendering Trigger point:

view controller lifecycle discussion - beforeRendering

Callstack1:

view controller lifecycle discussion - beforeRendering

h就是当前的html document:

Callstack2: 在当前的ui5 document ready之后,执行finishTask操作。

view controller lifecycle discussion - beforeRendering

Callstack3: 执行当前ui区域m[i]的rerender 方法:

view controller lifecycle discussion - beforeRendering

Callstack4: 调用render manager 绘制JS view:

view controller lifecycle discussion - beforeRendering

绘制的位置就是html里面id为content的DIV元素:

view controller lifecycle discussion - beforeRendering

Callstack5: render manager 开始render JS view:

view controller lifecycle discussion - beforeRendering

Callstack6: 在render manager的实现里,首先掉beforeRender的callback:

view controller lifecycle discussion - beforeRendering

就在下面不远处还有AfterRender的callback调用:

<img src="https://user-images.githubusercontent.com/5669954/28252973-2698db8c-6ad0-11e7-9a58-cbb707e0ed47.png)

Callstack7: JS view instance调用sap.ui.core.mvc.View.onBeforeRendering方法:

view controller lifecycle discussion - beforeRendering

Callstack8: fire BeforeRendering:

view controller lifecycle discussion - beforeRendering

Callstack9: 和之前的onInit一样,JS view instance调用EventProvider的方法fireEvent来调用beforeRendering callback:

view controller lifecycle discussion - beforeRendering

最后application的onBeforeRendering被调用:

view controller lifecycle discussion - beforeRendering

继续阅读