zoukankan      html  css  js  c++  java
  • SAP Fiori Elements应用里Back按钮的实现逻辑分析

    One of my colleagues today asked me this question: Suppose this below is an application generated by Smart Template, and I would like to debug how the back button is implemented. Since the whole UI page is implemented by framework, I don’t know where to set breakpoint. How to proceed?

    Here below is my process about how to find the back implementation in framework file within several minutes.

    (1) Use Chrome extension Inspector ( the UI5 tab in Chrome development tool below ) to figure out that the button is located in UI area sap.uxap.ObjectPageHeader.

    Based on the learning in My understanding about how object page in Smart Template is rendered I search by keyword “Back” in file Details.view.xml first, no result.

    (2) Then search in next xml file NavigationBar.fragment.xml, this time the button is found.

    Perform global search via Ctrl+Shift+F with key word “_templateEventHandlers.onBack“, no result.

    Then search “_templateEventHandlers” instead, this time TemplateAssembler-dbg.js is found.

    Unfortunately it is difficult to judge the type of _templateEventHandlers simply from context code as it is filled in a generic way.

    (3) Perform search on onBack instead, and the result is what I am looking for:

    Set a breakpoint and click back button to verify: breakpoint is triggered:

    So the trick here is the keyword I am using to search in a tentative way.

    • first time search by _templateEventHandlers.onBack, no result
    • second time search by _templateEventHandlers, has result but not useful
    • third time search by onBack, done.

    要获取更多Jerry的原创文章,请关注公众号"汪子熙":

  • 相关阅读:
    (转)TweenMax动画库学习(三)
    (转)TweenMax动画库学习(二)
    (转)TweenMax动画库学习(一)
    深入剖析Java中的装箱与拆箱(转)
    Spring MVC 和 Spring 总结(转)
    react native for android(ajax)
    React Native HelloWorld
    C# JMAIL发送邮件
    C# 接收邮件
    Spring Mvc Mybatis(初次学习)
  • 原文地址:https://www.cnblogs.com/sap-jerry/p/13592154.html
Copyright © 2011-2022 走看看