Creates a list box from which users can make selections from a list or trigger actions such as enclosing a file or submitting the form.
acclabel, active, bgcolor, border, borderinfo, focused, fontcolor, fontinfo, format, group, help, itemlocation, itemnext, itemprevious, keypress, label, labelbgcolor, labelborder, labelfontcolor, labelfontinfo, mouseover, next, previous, printbgcolor, printlabelbgcolor, printfontcolor, printlabelfontcolor, printvisible, readonly, size, suppresslabel, value, visible, xformsenabled, xformsreadonly, xformsrequired, xformsvalid, xforms:select, xforms:select1
This is an example of a list that allows the user to select the gender of a patient. The example shows a fragment of an XForms instance and an XFDL list item, both of which are inside the same form. The XForms fragment contains an empty gender element. The gender element remains empty until the user makes a selection from the list.
<xforms:instance id="Patient">
<record xmlns="">
<patient>
<name>Jane Doe</name>
<gender></gender> <!-- empty until a selection is made, then F or M -->
...
</patient>
</record>
</xforms:instance>
...
<list sid="Gender">
<xforms:select1 ref="patient/gender" appearance="compact">
<xforms:label>Patient Gender</xforms:label>
<xforms:item>
<xforms:label>Female</xforms:label>
<xforms:value>F</xforms:value>
</xforms:item>
<xforms:item>
<xforms:label>Male</xforms:label>
<xforms:value>M</xforms:value>
</xforms:item>
</xforms:select1>
</list>
The list can also be populated with data from an XForms instance, as follows:
...
<xforms:instance id="Patient">
<record xmlns="">
<patient>
<name>Jane Doe</name>
<gender></gender> <!-- empty until a selection is made, then F or M -->
...
</patient>
</record>
</xforms:instance>
...
<xforms:instance id="Genders">
<genders xmlns="">
<gender label="Female" code="F"/>
<gender label="Male" code="M"/>
</genders>
</xforms:instance>
...
<list sid="Gender">
<xforms:select1 ref="patient/gender" appearance="compact">
<xforms:label>Patient Gender</xforms:label>
<xforms:itemset nodeset="instance('Genders')/gender">
<xforms:label ref="@label"/>
<xforms:value ref="@code"/>
</xforms:itemset>
</xforms:select1>
</list>
This allows you to dynamically update the list by updating the <xforms:instance id="Genders"> element with Web service results obtained by an <xforms:submission> or by XForms actions such as <xforms:insert> and <xforms:delete>.
For examples of list entries that trigger actions, see the XFDL cell item.
page_sid.list_sid.value
For example:
compute="PAGE1.Gender.value"
page_sid.list_sid.value->value
Similarly, to obtain the <label> text of the selected cell:
page_sid.list_sid.value->label
Similarly, to obtain the sid of the selected cell:
page_sid.list_sid.value