list-question

The list-question element can be used to display a panel which contains a list of elements, each with a label and image and a check-box to allow the user to select this item. Typically, the items displayed within the list are people, as in the example below. However, other kinds of entity can also be used, for example, employers.

To create a list question, you need to specify the label for the overall question, the entity from which to read the items in the list, the attribute(s) to use as the label for each item and the attribute on the entity to set based on whether the check-box is checked or not for each item. The xml used to create the above list question would therefore look something like this:

Figure 1. List question XML
<list-question entity="Person" id="isBlind">
  <label id="IsBlind.Label">
    <![CDATA[Please choose the people who are blind:]]>
  </label>
  <item-label>
    <label-element attribute-id="firstName"/>
  </item-label>
</list-question>

List questions can also be used on summary pages to display the choices the user has made. In this case, only those items selected will be displayed.

One thing to be aware of when using list questions is that in order to ensure that the full width of the page is available to them, they should always be added to a cluster whose label-width has been set to 0.

The list question element can also be used to display a question matrix, which is a list question with a codetable data type. In this case, there will be a table displayed with a column for each entity, containing radio buttons to indicate the multiple-choice options defined in the codetable.