A choice list is a collection of predefined property values which can be used to present users with a list of values from which to choose. Using a choice list:
A choice list is an object that contains a list of choices. An example of a choice list is a list of the two-letter state codes that represent U.S. states. Choices consist of a display value and an actual value which is persisted in the database.
To make a choice list usable, you must assign it to a property template. See Create a choice list which includes the requirement to assign the new choice list to a property template for more information. Enterprise Manager does not allow you to delete the choice list object as long as it is associated with a property template. One choice list can be used by many properties. A choice list cannot be used within another choice list.
Content Engine installations using a case sensitive database can distinguish between case sensitive items in a choice list. Using a database, an item in a choice list could be set to "ITEM1" while another could be set to "item1", and the two would be successfully handled and queried.
NOTE The Choice list size site preference determines the maximum number of choice list elements to display. A Workplace XT or Workplace user can see no more than the pre-set number of choice list elements, with no indication that more elements might exist.
To provide users with quick, easy selections when they enter data, follow these guidelines:
The Create a Choice List wizard:
The Create a Property Template wizard:
Enterprise Manager provides a way that you can localize the display names of a choice list.
Choice lists have their own security. By default, the Choice List wizard automatically assigns to the new choice list the security defined on the Default Instance Security tab of the Choice List class, which is initially the same security as the object store:
To change these default settings, you can either change the Default Instance Security of the Choice List class before creating the choice list (the Choice List class is not subclassable), or you can directly edit the security of the choice list by opening its property sheet, clicking the Security tab, and directly assigning security. For example, if you had two groups of users with basic View access to the object store, you could deny the right of one of the groups to see a particular choice list.
Typically, you cannot import a choice list (or any other class of object) if the object store already has an object with the same GUID or Name. As explained in the topic Importing an XML file into an object store, the Enterprise Manager Import Helper checks for duplicate components and does not overwrite an existing object with a duplicate. When encountering a duplicate object, the Import Helper records the duplicate entry as an error in a log file and continues to import objects that have not already been added to the object store.
The following example shows the property sheet of a choice list named "Fish" which contains two groups, each containing three items. An application could be designed so that the user would first choose the group, and then be offered to choose only the items within that group.
When displayed by Enterprise Manager, each item consists first of the DisplayName Property (a simple localizable string property), followed in parentheses by the Value Property (the data type of which is determined by the data type, string or integer, of the choice list).
Enterprise Manager enforces uniqueness of group names within a single choice list, and also uniqueness of display names within a single group. However, it does not enforce the uniqueness of item values. (There are use cases where uniqueness is not desirable.) To understand the possible consequences of having duplicate item values, consider the following example:
This example shows a choice list named "Color choices" that contains the following duplicate item values: a blue car and a blue boat. After a choice is made, you cannot tell whether it was the blue car or the blue boat that was selected. To avoid this uncertainty, you can add more information to the values by specifying for Car "blue(blue car)" and for Boat "blue(blue boat)".
When a choice list object is created, only the actual value of the choice list item is stored. This value contains no direct reference to the choice list item from which the value was originally selected. It also does not "know" what the display value was for that selected choice list item.
The value of a property of an object is only loosely connected with the choice list by means of the property definition of the class of the object. When determining the display value of the property of the object in the user interface, the Content Engine tries to match the actual value of the property with the current choice list items. It takes the display value of the choice list item that has a matching actual value with the property value of the object.
Using a choice list might not be appropriate if you expect that changes to the list might cause the relationship between stored values and displayed values to change. The following scenarios illustrate the problems that potentially occur when an object references a choice list with a changed item value relationship. Note that only changing or deleting existing items in a choice list (and not adding new items) can cause these potential problems.
Consider a class of Pencil with a property Color, which is associated with the following choice list (listed as Display Value/Stored Value pair):
Red – 1
Green – 2
Blue – 3
The user creates a pencilA object (an object that is an instance of the Pencil class) and selects Red for color. In the Content Engine database, only "1" is stored for the Color property of pencilA, not "Red" nor a reference to the choice list item.
When the user searches for pencils with value of Color as criteria, pencilA is not found, because it is no longer available as a search value in the list (you cannot type in a value). Therefore, there is currently no way to find pencilA by searching on Color.
If the user looks at the Color property of pencilA, the property has a blank value with only Green and Blue as the options in the list. In the database, the Color of pencilA still has the value of 1, but since that value does not match any of the actual item values in the current choice list (2 and 3), the application shows the default, which is blank. The user consequently receives the wrong impression that there is currently no value set for the property.
The user creates a pencilB and selects White in the list for color. In the database, the only thing stored for the Color property of pencilB is 1, not White. Now the user has pencilA and pencilB both with the same value of 1, while for pencilA it means Red, and for pencilB, it means White. Both pencilA and pencilB are treated by the application as having the same Color value of 1. When the user searches for White pencils, both pencilA and pencilB are returned, even though pencilA was meant to be Red when it was created.
When the user looks at the Color property of pencilA, the property has a value of White with Green and Blue as the options in the list. But the original and intended color of pencilA is Red.
The user creates a pencilC with Color = Red. In the database, the only thing stored for the Color property of pencilC is 4. The user intends both pencilA and pencilC to have the same Red color, but to the system, pencilA and pencilC have different colors (1 and 4 respectively). When the user tries to search for Red pencils, the system returns only pencilC instead of both pencilC and pencilA. And when the user looks at the Color property of pencilC, the property has a blank value (instead of Red) with Red, Green and Blue as the options in the list.