MenuLiteral Element (Data)

From HLKitWiki
Revision as of 03:45, 2 December 2008 by Rob (talk | contribs) (New page: {{context|Kit Reference|Data File Reference|Portal Element (Data)}} ==The "menu_literal" Element== Menus are useful whenever you need the user to select exactly one item from a collectio...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Context: HL Kit … Kit Reference … Data File Reference … Portal Element (Data) 

The "menu_literal" Element

Menus are useful whenever you need the user to select exactly one item from a collection of options. The role of the "menu_literal" element is to allow you to specify a fixed set of options to choose from. An classic example is the selection of gender on the "Personal" tab, where a menu allows the user to select either male or female. The complete list of attributes for this element is below.

field Id – Specifies the unique id of the field whose contents reflect the current selection from the menu. The field must be a value-based field and must exist within the pick/thing associated with the containing template. If this portal is not defined within a template, a menu is not allowed.
maxvisible (Optional) Integer – Specifies the maximum number of items that will be visible at one time within the menu when the user opens it for selection. If there are more items to choose from, a scroller will allow the user to access them. Default: "5".

Example

The following example demonstrates what a literal menu portal might look like. All default values are assumed for optional attributes.

<portal id="gender" style="menuNormal">
  <menu_literal field="perGender">
    <choice value="0" display="Gender: Male"/>
    <choice value="1" display="Gender: Female"/>
    </menu_literal>
  </portal>