'CustomWebResolver' – Lists

In order to resolve List components correctly, it is necessary to map the component containing all list entries, i.e. the list itself, as well as the components which represent the individual list entries.

ClassRequired components and sub-items
ListRepresents the List component, contains all list entries.
Item:ListItemRepresents the individual list entry.
 Optional sub-items
CheckBox:ListItemCheckBox(Optional) Represents a checkbox inside the list entry.
Icon:ListItemIcon(Optional) Represents an icon inside the list entry.
Table 49.4:  Mapping of Lists

In the case of combo boxes you can also map the specific ComboBoxList: List:ComboBoxList and Item:ComboBoxListItem.

Sample:

The following HTML code represents a list:

<ul class="datalist">
  <li class="list-item">Entry A</li>
  <li class="list-item">Entry B</li>
  <li class="list-item">Entry C</li>
  <li class="list-item">Entry D</li>
  <li class="list-item">Entry E</li>
</ul>
Example 49.24:  HTML list

This HTML code offers the choice whether to map the HTML tags or the CSS classes. We highly recommend to use the CSS classes, as this will be a lot more precise. datalist strongly hints that the element refers to a list in the sense of QF-Test. With list-item we can add ancestor: List to be sure not to map sub-items of other complex components (e.g. with table cells not shown here, which very well could have the CSS class list-item)

If we used the HTML tags, this might easily lead to wrong mappings with other components. If such a thing should happen, and you find it difficult to know why a mapping is not working, you can use the procedure qfs.web.cwr.dumpConfiguration to display the currently configured mappings.

genericClasses:
- List: datalist
- Item:ListItem:
    class: list-item
    ancestor: List
Example 49.25:  HTML list