view controller lifecycle discussion - beforeRendering

Created by Jerry Wang on Aug 07, 2014

BeforeRendering Trigger point:


view controller lifecycle discussion - beforeRendering



Callstack1:


h就是当前的html document:


view controller lifecycle discussion - beforeRendering

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调用:


view controller lifecycle discussion - beforeRendering

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


上一篇:local sandbox html里的script tag是如何load到memory里的


下一篇:SAP UI5框架 component.js的加载原理