Attributes

Category and Sub-Category Attributes

Screenshot
Suppose you have two enumerated attributes, one called “Category” and the other called “Sub Category”. You want the enumerations available for “Sub Category” to be dependant on the value of “Category”. This cannot be done in doors using enumerated attributes.

However, with some simple DXL, you can create the illusion of this functionality. Instead of using enumerations, use ordinary string attributes and use a dialog to edit the values.

This utility implements a dialog box that allows the user to select values for “Category” and “Sub Category”. Whenever the “Category” value is changed, the available values for “Sub Category” are automatically updated.

The “pseudo enumerations” are implemented as string arrays. Each row contains a “Category” value in the first position and available “Sub Category” values in subsequent positions.

Two scripts are provided. The first, editCategory.dxl, implements the dialog and contains the definitions of the category and sub category values. The second, categoryMenu.dxl, allows you to add the script to the popup menu of a formal module.

View editCategory.dxl.

View categoryMenu.dxl