SAP WebClient UI是如何维护表格选中状态的

简介: SAP WebClient UI是如何维护表格选中状态的

I have been working as a Fiori application developer in SAP for almost two years, which means now I use Chrome development tool in my daily work for trouble shooting instead of ABAP debugger when I was working using CRM WebUI.


Yesterday I was assigned with an incident about CRM Lead application in WebUI, and I am glad to figure out that Chrome development tool can also do me a great favor for my trouble shooting in WebUI issue. I share with my experience learned in this blog.


Issue description

The incident complains that when a given row in Products assignment block is selected and Delete button in toolbar is clicked, nothing occurs.



image.png

My issue analysis process

I located the event handler of this delete button in toolbar:image.pngAnd I find out that get_marked in line 21 return an empty BOL entity collection.image.pngI debugged into get_marked, this method will only return those BOL entities as marked whose SELECTED equals to true.

For Lead application, all the BOL entities which represent table entries in assignment block has SELECTED as false, as a result no BOL entity is returned – so nothing to be deleted.



image.pngHowever I have checked Opportunity application, the deletion works. The attribute for BOL entity is set as abap_true as expected.image.pngWhat is the reason of this different behavior?

Research how WebUI passes table selected row information to ABAP backend via Chrome development tool

In WebUI I selected first row in table and click delete button in toolbar, then I observe this selected information is passed to ABAP backend via field name asC34_W111_V113_V120_prodtable_selectedRows and value as 1.


image.pngAnd in ABAP backend, all these http form fields passed from frontend UI are received and stored in variable lt_fields in line 25.image.pngI download the content of lt_fields as excel and highlight the field for selected row index:

image.pngThen in ABAP backend, it is expected to populate the string “C34_W111_V113_V120_prodtable_selectedRows” to get the index by field name. From the code below we get: “C34_W111_V113_V120_prodtable“



image.pngThe left string fragment “selectedRows” comes from constant gc_selected_rows. Now the selected row index is get by field name in line 14.image.pngThe original issue is: although we have table id “prodtable”,image.pnghowever a wrong default id “Table” is passed in via iv_id and thus wrong field name is generated, so based on this wrong field name, no selected index could be queried:



image.pngThe issue is already fixed via SAP note 2331513.

The naming convention of capital characters in lv_name:


C: component

W: window

V: view

You can also find such id in generated html source code via Chrome development tool in Element tab: first click the small icon highlighted below and then click the UI area you would like to inspect:



image.pngThen in Elements tab, the html source code of the selected UI area will be displayed for you:image.pngFurther reading

Chrome Development Tool tips used in my daily work

My UI5 debugging tips and experience collection – how to resolve UI5 issues through debugging by yourself


相关文章
|
3月前
|
前端开发
Element UI 【实战】纯前端对表格数据进行增删改查(内含弹窗表单、数据校验、时间日期格式)
Element UI 【实战】纯前端对表格数据进行增删改查(内含弹窗表单、数据校验、时间日期格式)
126 6
|
21天前
|
JavaScript
element-ui table表格多选后再打开默认选中
element-ui table表格多选后再打开默认选中
|
2月前
|
前端开发 JavaScript UED
element-ui 表格数据究竟隐藏着怎样的神秘样式与格式化技巧?快来揭开谜底!
【8月更文挑战第22天】《element-ui 表格数据样式及格式化案例》展示了如何利用 element-ui 的表格组件实现美观且易读的数据展示。通过简单配置,可以自定义表格样式,如边框、背景色等,并通过 formatter 实现数据格式化,例如将成绩保留一位小数。此外,还能依据条件设置行样式,如成绩达优则高亮显示,从而增强用户体验和数据可读性。
51 1
|
2月前
|
JavaScript 开发者
Element UI & Element Plus之改变表格单元格颜色
这篇文章展示了如何在Element UI和Element Plus框架中使用`:cell-style`属性来根据条件改变表格单元格的颜色。
162 0
Element UI & Element Plus之改变表格单元格颜色
|
2月前
|
计算机视觉
ElementUI——vue2+element-ui 2.x的动态表格和表单
ElementUI——vue2+element-ui 2.x的动态表格和表单
35 1
|
2月前
|
JavaScript 前端开发 Shell
Element-ui Table表格导出功能的实现
Element-ui Table表格导出功能的实现
32 0
|
3月前
Element UI 多选表格--判断勾选数据行的 Checkbox 时为选中还是取消选中
Element UI 多选表格--判断勾选数据行的 Checkbox 时为选中还是取消选中
31 1
|
3月前
Element UI 多选表格【翻页多选】简易版(不支持翻页多选数据反显)
Element UI 多选表格【翻页多选】简易版(不支持翻页多选数据反显)
53 0
Element UI 多选表格【翻页多选】简易版(不支持翻页多选数据反显)
|
3月前
Element UI 表格【列宽自适应】
Element UI 表格【列宽自适应】
71 0
|
3月前
Element UI 【表格合计】el-table 实战范例 -- 添加单位,自定义计算逻辑
Element UI 【表格合计】el-table 实战范例 -- 添加单位,自定义计算逻辑
197 0
下一篇
无影云桌面