Working With Drop-Down Lists
You can add drop-down lists to Data Grid cells to make it easier for users to submit the appropriate value and to reduce input error. Users cannot type in a cell that contains a drop-down list; however, they can paste values into the cell. Likewise, users can run a model that affects a cell with a drop-down list.
- Drop-down lists are not enforced in any of the following circumstances:
- line item details intersect with the drop-down list
- the cell has been protected using the Protect function
- the cell is unlocked or read-only
Before you can add a drop-down list, you must decide whether to use the default attribute or create a custom attribute.
For more information, see one of the following topics:
Using the default drop-down list attribute
By default, the system uses the ZValidValues attribute. This attribute already exists in your system. If ZValidValues contains a value and the relevant Data View does not specify a custom attribute using the ValidValuesAttribute function, the system uses this attribute by default for any drop-down lists for that symbol. For information on adding drop-down list values for this attribute, see Adding drop-down list values.
If you want to use your own custom drop-down list attribute, see Creating a custom drop-down list attribute.
Creating a custom drop-down list attribute
Longview allows you to create custom drop-down list attributes. If you use a custom attribute, you must also set the ValidValuesAttribute function in the relevant Data View definition. For more information, see ValidValuesAttribute.
To create a drop-down list attribute:
- In Longview Application Administrator, click New, and select Attribute in the list. The New Attribute Definition dialog opens.
- Complete these fields:
Field Description Class
Select SYMBOL.
Name
Specify a name for the drop-down list attribute.
Description
Specify a description for the attribute.
Type
Select List, and then select one of the following:
- Date
- String
- Symbol
- When you are finished, click OK.
- Continue to “Adding drop-down list values”.
Adding drop-down list values
To add a drop-down list to a cell, you must set the attribute to the required values for the appropriate data intersection.
Caution: This feature can be used in either the across dimension or the down dimension of a Data Grid, but not both. Any intersection where both symbols include a drop-down list results in an error for that data intersection.
To set the drop-down list attribute:
- In Longview Application Administrator, right-click the symbol to associate with a drop-down list, and select Properties on the context menu. The symbol Properties dialog opens.
- Click the Attributes tab.
- In the Attributes list, locate the ZValidValues attribute, or the attribute that you created for the drop-down list, and click in the Value column. For more information, see Using the default drop-down list attribute or Creating a custom drop-down list attribute.
- Type the items to include in the drop-down list, separated by a pipe ( | ) symbol. Use a semicolon ( ; ) within each list item to specify both a display value and a return value for that item. The string to the left of the semicolon is the display value and the string to the right is the return value. For more information, see “Example”.
Note: Drop-down list items are case sensitive. Any input by a user as well as any references in Longview Application Framework documents must take this case sensitivity into account.
- If you are using a custom attribute, specify the ValidValuesAttribute function in the required data view. For more information, see ValidValuesAttribute.
Example:
To add a drop-down list that allows users to select an employee type of Full Time, Part Time, or Contract, type Full Time|Part Time|Contract.
To add a drop-down list that displays Jan, Feb, and Mar, but returns the values p1, p2, and p3 respectively, type Jan;p1|Feb;p2|Mar;p3.
ValidValuesAttribute
After you create a custom drop-down list attribute, you must use the ValidValuesAttribute Data View function to specify the drop-down list attribute to associate with a Data Grid. You can specify only one ValidValuesAttribute function per Data View document. The system uses the ZValidValues attribute unless you specify a custom attribute using this function.
Syntax:
ValidValuesAttribute "AZAttribute"
where:
- Attribute is the appropriate Symbol attribute. For more information, see Creating a custom drop-down list attribute”.
Example:
ValidValuesAttribute “AZDropDownAttribute”