“onBeforeRendering” or “onAfterRendering” is not called every time the view is opened

前端 未结 4 794
庸人自扰
庸人自扰 2020-12-11 07:16

In my UI5 app, I have a view with a table (sap.m.Table), populated by data coming from the back-end at onInit hook. The problem is that onInit is e

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 08:11

    Question #3:

    patternMatched is going to get hit when your router is matched on the URL or on the router.navTo method.

    routeMatched is going to get hit on the same occasion as patternMatched and when its child routes get navigated to.

    Imagine, you have a master view on route A and it’s detail on route B. If the user navigates directly to route B, it makes sense to render the target associated to route B and also the target associated to route A.

    To conclude:

    • patternMatched: direct route match

    • routeMatched:

      1. The pattern of a route in this router.
      2. The pattern of its sub-route.
      3. The pattern of its nested route. When this occurs, the nestedRoute parameter is set with the instance of nested route.

提交回复
热议问题