Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

How to associate a logical type with an enumeration
xomega
#1 Posted : Wednesday, October 17, 2012 5:05:13 PM(UTC)
xomega



After you define a static enumeration in the model or describe a dynamic enumeration based on a service operation that returns a list of values, you can associate that enumerations with a logical type defined in the model. The logical type would typically extend a base type enumeration (or integer enumeration if the values are integers), which is already mapped to appropriate data properties and selection controls.

In order to associate the logical type with a static or dynamic enumeration you need to do the following.
  1. Add enum element inside the type element of your logical type definition.
  2. Set the ref attribute to the name of a static or dynamic enumeration defined in the model.

After you link the logical type to an enumeration like that, any field or parameter using that type or any of its subtypes will be automatically configured to accept a value or a list of values from this enumeration.

The following example shows how the marital status logical type is associated with the marital status enumeration.
Code:
<types>
  <type name="marital status" base="enumeration">
    <enum ref="marital status"/>
  </type>
</types>
<enums>
  <enum name="marital status">
    <item name="Single" value="S"/>
    <item name="Married" value="M"/>
  </enum>
</enums>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Copyright © 2009-2022 Xomega.Net. All rights reserved.