使用调试的方式搞清楚SAP UI5应用标题的更改方式
In Fiori launchpad, the page title will display default value “Home”. When I click a given tile to enter an UI5 application, the page title is changed for example from “Home” to “My Tasks”.
Today I am dealing with an incident that once I have entered one application, the page title is not displayed correctly, see below error screenshot:
In order to fix this issue, I need to know exactly which line has changed the value of page title.
Since I don’t have any clue why page title becomes like this when I enter the erroneous application, so my thought is if I can test with an application where the page title works correctly, and if I can find out the line of code for title value assignment, then I can set breakpoint on that line and debug back with erroneous application.
Thanks to the power of Chrome development tool, I can finish trouble shooting in a quite efficient way.
First step, Identify which html tag holds the value of page title. Open Chrome development tool, click Elements tab and locate the tag “title”. Change its value and the change will refresh in browser immediately. This proves the fact that it is title tag which holds page title.
Then right click this title element, choose “Break on…” and mark all three options.
Now go back from application to launchpad by clicking back button, break point is triggered.
Navigate back to an application where page title display works. So it is Shell.controller.js who is responsible to change page title with variable sTitle. Now my task is to find out how variable sTitle is filled.
Go back to an outer callstack frame, sTitle comes from one attribute of object oMetadata. So where is oMetadata filled?
In line 892, now I understand: the oMetadataConfig comes from metadata configuration defined in Fiori application:
And this is i18n.properties file:
For a complete blog list of how I use Chrome development tool in my daily work, please find it from this blog: Chrome Development Tool tips used in my daily work.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- SAP UI5 应用开发教程之四十九 - 如何在桌面电脑端调试运行在手机上的 SAP UI5 应用试读版
- SAP UI5 应用启动(bootstrap)过程单步调试
- 使用调试的方式搞清楚SAP UI5应用标题的更改方式
- SAP UI5的表格里如何显示复合列
- SAP UI5 formatter的原理和调试截图-当UI字段没有值显示时怎么办
- SAP UI5应用的一个调试参数 - sap-ds-debug=true
- SAP和CRM相关的标准教材,学通了这些,就算是CRM专家了
- 如何关闭SAP ICF调试
- SAP 电商云 Product-loading.service.ts 的实现
- SAP Spartacus 里的 .release-it.json 文件
- SAP Spartacus 如何调试待翻译文本的 place holder 和翻译之后的值
- SAP Spartacus里的HTTPErrorInterceptor的单元测试设计原理
- SAP Spartacus CmsPage的加载逻辑
- SAP CRM系统里关于订单货币单位为日元的一些调试和配置关键点
- 如何调试SAP CRM产品主数据应用后台ABAP端抛出的错误消息
- SAP S/4HANA里修改了Business Partner后的调试入口
- 使用SAP WebIDE创建开发Java应用,并且在浏览器里调试
- SAP UI5 应用开发教程之四十九 - 如何在桌面电脑端调试运行在手机上的 SAP UI5 应用试读版
- 关于 SAP Fiori Elements 应用标题属性(title) 的复制逻辑单步调试
- SAP UI5应用的一个调试参数 - sap-ds-debug=true
- SAP UI5 应用启动(bootstrap)过程单步调试