pp108 : enumerated

enumerated

It denotes whether the select and list controls can hold enumerated data.
Enumerated data consists of multi-valued entries that are contained in a single object. For example, if data such as an object contains a particular node that occurs multiple times, as shown in the following code, it is enumerated data.

<tuple>
    <old>
        <Employees>
            <EmployeeID>100</EmployeeID>
            <FirstName>Andrew</FirstName>
            <LastName>Fuller</LastName>
            <PhoneNumbers>
                <PhoneNumber>23647623</PhoneNumber>
                <PhoneNumber>23434433</PhoneNumber>
                <PhoneNumber>24343434</PhoneNumber>
            </PhoneNumbers>
        </Employees>
    </old>
</tuple>

In the above code, the Select control holds enumerated data because its Reference property returns a collection of nodes, instead of a single node.

Note:

If the enumerated property is set for a control, there is no need to pre-fill the control through Data set property.

Syntax

Design Time

This is a design-time property and can be set through the property sheet of the select and list controls.

Remarks

Data can be bound to a Select or a List control as follows:

  1. Custom data can be filled during design time by giving the value and description for each of the options on the property sheet of the control. It can be filled during runtime by calling the addOptions method of the element and passing the option objects collection which have the value and description properties.
  2. The data of the Select or List control can be bound to the model. The reference (xql) property must point to a node in the response object, whose data or text property will be taken as the value and description of the option, by default. Refer to the onbeforefill event for changing the value of the option. In the following code, an option is created for each example in the data.
    <tuple>
        <old>
            <Employees>
                <EmployeeID>1</EmployeeID>
                <FirstName>Nancy</FirstName>
                <LastName>Davolio</LastName>
                <car>Ford</car>
            </Employees>
        </old>
    </tuple>
    
    If the Reference property is set to Employees and car, then each object in the above example will point to an option in the Select or List control.
  3. The Select or List controls can be made to hold enumerated data. The control must be bound to a model. The XPath given for the Reference (xql) property must return a collection of nodes when executed on the response. An option is created for each node in the set. The following is an example of this method.
    <tuple>
       <old>
         <Employees>
              <FirstName>Nancy</FirstName>
              <LastName>Devoli<LastName>|
              <cars>
                 <car>
                    <brnad>Ambassdor<brand>
                    <color>blue</color>
                 </car>
                 <car>
                   <brand>Ford</brand>
                   <color>blue</color>
                 </car>
              </cars>
         </Employees>
       </old>
    </tuple>
    

Applies to

Select, List