Creating a list box for a new attribute

You can create list boxes for newly created attributes.

About this task

To create a list box on the Properties dialog for objects of a given type, create an attribute on the text type that is called info_attrs. The syntax for an entry in the info_attrs attribute is as follows:

attr_name:attr_type[:[label][:#textlines]] |
 attr_name:attr_type[:[label]:[#textlines]:values_ref]

where values_ref is defined in a new values definition entry, in a separate attribute.

Each values_ref values definition entry must be defined in a separate text attribute on an object or type called info_attrs.values_ref, where values_ref is the name of the list of values referred to in the info_attrs definition. By defining each values definition entry in a separate text attribute, the list of values can be more easily populated from external tools.

A values_ref entry must be a legal attribute name because it becomes part of the name of an attribute. A values_ref attribute name is limited to 21 characters because the limit on the length of an attribute name is 32 characters, and 11 characters are used by the info_attrs string.

The contents of an info_attrs.values_ref attribute must be a newline-separated list of possible values.

A value in a value list can be any ASCII string with embedded white space permitted. No leading or trailing white space is permitted because such white space is considered part of the newline delimiter.

Procedure

This procedure provides an example of creating a list box for a new attribute. Suppose you want to add a custom attribute to the task type called approval_level, and the possible values for this attribute are from the following list:

  1. To create an entry in the info_attrs attribute on the task type, enter the following string: approval_level:string:Approval Level::approval_values
  2. Create an attribute on the task type that is called info_attrs.approval_values and that has these contents:
    • new
    • pending
    • approved level 1
    • approved level 2

Feedback