MenuArray Element (Data): Difference between revisions

From HLKitWiki
Jump to navigationJump to search
New page: {{context|Kit Reference|Data File Reference|Portal Element (Data)}} ==The "menu_array" Element== The "menu_array" element allows you to create a menu whose options are dynamically determ...
 
No edit summary
Line 14: Line 14:
|maxvisible
|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".
|(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".
|-
|}
The "menu_array" element also possesses child elements that define additional facets of the portal. The list of these child elements is below and must appear in the order shown. Click on the link to access the details for each element.
:{| class="infotable"
|class="leftnormal"|[[#change|change]]
|An optional "change" element may appear as defined by the given link. This element defines a [[Change Script]] for the portal.
|-
|}
==The "change" Element{{anchor|change}}==
The "change" element defines a [[Change Script]] for the portal that is invoked whenever the user selects a new choice from the list of options. This script allows the implications of the new selection to be integrated and the display updated. The complete list of attributes for this element is below.
:{| class="infotable"
|class="leftnormal"|PCDATA
|Script – Specifies the code comprising the Change script.
|-
|-
|}
|}

Revision as of 21:01, 2 December 2008

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

The "menu_array" Element

The "menu_array" element allows you to create a menu whose options are dynamically determined via scripts. These scripts setup the contents of the array that dictates the available options. 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 text-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.
array Boolean – Specifies the unique id of the array-based field to be used to drive the available options. The field must be text-based, must be an array, and must exist within the pick/thing associated with the containing template.
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 an array-based menu portal might look like. All default values are assumed for optional attributes.

<portal id="menutext" style="Menu" width="150">
  <menu_array field="pwmTextSel" array="pwmList" maxvisible="9"/>
  </portal>