SAP CRM WebClient UI element id generation logic

123 阅读1分钟
# Created by Jerry Wang, last modified on Jan 20, 2015UI element在runtime render时,会按照一定逻辑生成id: clipboard1 clipboard2首先根据ui element所在的hierarchy得到其parent view的id,作为该ui element id的prefix: clipboard3 如果该ui element是其parent的第一个children ,则其id为1,( line 22 ), 否则其id为当前计数器+1 ( line 16) clipboard4最后id的拼接逻辑如下: clipboard5 clipboard6

 

 

@i042416 i042416 added the CRM WebUI label on Jul 10, 2017

@i042416

Owner Author

i042416 commented on Jul 10, 2017

# UI element ID的生成逻辑## Created by Jerry Wang on May 19, 2014在webclient UI上通过F12 - developer tool观察任意的ui field,比如下图中的search field,发现其technical name是由很多的naming convention如C,W,V和数字组成。 clipboard1 这些name都是由Webclient UI框架class根据workbench里define的tag, 如thtmlb:advancedSearch tag自动生成的: clipboard2 在下列input field generator class的FACTORY方法里设断点,launch webclient UI, 断点触发: clipboard3 在最后生成的html page里能根据上图debugger中的ID找到对应的html element: clipboard4 在debugger里观察到的前缀C1_W1_V3_V4里的数字是通过下面的class 自身维护的计数器id_count来实现的: clipboard5 而所有数字前面的字母前缀的代表含义在下列class的constant attribute里定义: clipboard6