Advanced Customization > Info*Engine User’s Guide > Display Webject Reference > Display Webjects for HTML > Display-Selection
  
Display-Selection
DESCRIPTION
Generates HTML form elements such as OPTION and SELECT with attributes of NAME, SIZE, and MULTIPLE, producing a selectable list in the form of a drop-down menu or a list box in a browser window.
* 
The FORM element is not automatically generated by this webject. To display the lists correctly, include the <FORM> and </FORM> tags as shown in the examples.
SYNTAX
<ie:webject name="Display-Selection" type="DSP">
  <ie:param name="ATTRIBUTE" data="attribute"/>
  <ie:param name="ATTRIBUTE_VALUE" data="attribute_value"/>
  <ie:param name="GROUP_IN" data="group_name"/>
  <ie:param name="LEADER" data="leader_char"/>
  <ie:param name="LIST_HEADER" data="addl_item"/>
  <ie:param name="LIST_HEADER_VALUE" data="addl_item_value"/>
  <ie:param name="MULTIPLE" data="[TRUE | FALSE]"/>
  <ie:param name="NAME" data="name"/>
  <ie:param name="SELECTED" data="preselected_value"/>
  <ie:param name="SIZE" data="display_height"/>
  <ie:param name="WIDTH" data="element_width"/>
</ie:webject>
PARAMETERS
Required
Select
Optional
LIST_HEADER
ATTRIBUTE
LIST_HEADER_VALUE
ATTRIBUTE_VALUE
MULTIPLE
GROUP_IN
SELECTED
LEADER
NAME
SIZE
WIDTH
ATTRIBUTE
Specifies the name of the object attribute whose value is used as the value attribute in the generated HTML OPTION element and as the value displayed, and whose attribute name is used as the name value for the generated HTML SELECT element.
If ATTRIBUTE_VALUE is specified, then the name value of the HTML SELECT element and the value attribute of the HTML OPTION element is determined by ATTRIBUTE_VALUE, while the value displayed by the HTML OPTION element remains the value specified by ATTRIBUTE.
The default for this parameter is to use and display all attributes. Multiple values can be specified for this parameter. This parameter is optional.
ATTRIBUTE_VALUE
Specifies the name of the webject attribute whose value is used as the value attribute in the generated HTML OPTION element, as well as the name value for the generated HTML SELECT element; the value displayed remains the ATTRIBUTE value.
If ATTRIBUTE is not specified, then ATTRIBUTE_VALUE determines the name value for the generated HTML SELECT element and the value attribute in the generated HTML OPTION element, while the value displayed is determined by the ATTRIBUTE default.
The default for this parameter is to use the same attribute for the value submitted as for the value displayed. This parameter is optional.
GROUP_IN
Identifies the name of the group to be used as an input source. The group can be a VDB group or a Context group. The default for this parameter is to use the last group defined in the VDB. This parameter is optional.
For further information about groups, see Info*Engine Data Management.
LEADER
Specifies a string value to place between multiple attribute values. If no width parameter is specified, the LEADER value becomes a separator between the attribute values. The LEADER value can consist of one or more characters. If width is specified, the attribute value is padded with the LEADER value until the width is met or exceeded. The default for this parameter is "_". This parameter is optional.
LIST_HEADER
Specifies an additional selectable item to be displayed at the top of the drop-down list or list box. LIST_HEADER and LIST_HEADER_VALUE parameters are treated as a pair. If LIST_HEADER is specified, LIST_HEADER_VALUE must also be specified. Multiple values can be specified for this parameter.
LIST_HEADER_VALUE
Specifies the value of the LIST_HEADER item that is to be returned when the form is submitted, if the LIST_HEADER item is selected by the user. The LIST_HEADER parameter must be specified for the value of this parameter to be valid. Multiple values can be specified for this parameter.
MULTIPLE
Acts as a flag, allowing multiple objects to be selected from the selectable list. The default for this parameter is FALSE. Specify TRUE to enable multiple selections. You must also set the parameter to TRUE to be able to preselect all of the list values using the SELECTED parameter.
NAME
Sets the NAME value of the generated HTML SELECT element. The default for this parameter is to use the attribute name specified by ATTRIBUTE; or, if ATTRIBUTE_VALUE is specified, then the default for this parameter is to use the attribute name specified by ATTRIBUTE_VALUE. If neither ATTRIBUTE nor ATTRIBUTE_VALUE are specified, then the default for this parameter is to use the name of the first attribute. This parameter is optional.
SELECTED
Specifies which attribute value to use as the default selection in a drop-down menu or list box. You can select no values, a single attribute value, or all values. The default for this parameter is "". To set the default selection to all the values in the list, set the value of this parameter to "*". The MULTIPLE parameter must be enabled for all values to be preselected.
SIZE
Sets the number of options to be displayed at one time in the generated list box. If no value is specified, the default for this parameter is one item. If the default is used, or one item is specified, a drop-down menu is generated. If two or more items are specified, then a list box is displayed; scroll bars display when more items are returned than the specified SIZE parameter can display. This parameter is optional.
WIDTH
Sets the width of the OPTION element in the drop-down menu or list box. The default for this parameter is the size of the attribute. If more than one attribute is specified, then each attribute can have a WIDTH parameter specified. If more attributes than WIDTH parameters are specified, then the WIDTH parameters are applied on a one-to-one basis beginning with the first attribute, with the remaining attributes using the default value. This parameter is optional.
EXAMPLES
The following Display-Selection webject examples assume an input group containing multiple elements; each with a name, address and email attribute value:
DEFAULT DISPLAY
* 
The default for the SIZE parameter results in a drop-down menu.
Webject
<form>
<ie:webject name="Display-Selection" type="DSP"/>
</form>
Output
Generated HTML
<form>
<select name='NAME'>
<option value='Sam Johnson'>Sam Johnson1234 Main
                             St.sjohnson@somewhere.com</option>
<option value='Harvy Anderson'>Harvy Anderson1234 Amber
                            St.handerson@somewhere.com</option>
<option value='James O'Connor'>James O'Connor775 Main
                                                   St.</option>
<option value='Harvey Hampton'>Harvey Hampton775 Main
                             St.hhampton@somewhere.com</option>
</select>
</form>
DISPLAY A SINGLE ATTRIBUTE
* 
Specifying a value of "1" for the SIZE parameter results in a drop-down menu.
Webject
<form>
<ie:webject name="Display-Selection" type="DSP">
  <ie:param name="ATTRIBUTE" data="NAME"/>
  <ie:param name="SIZE" data="1"/>
</ie:webject>
</form>
Output
Generated HTML
<form>
<select name='NAME' size=1>
<option value='Sam Johnson'>Sam Johnson</option>
<option value='Harvy Anderson'>Harvy Anderson</option>
<option value='James O'Connor'>James O'Connor</option>
<option value='Harvey Hampton'>Harvey Hampton</option>
</select>
</form>
DISPLAY SINGLE ATTRIBUTE WITH DIFFERENT OPTION TAG VALUE
The following example shows the list that is generated when the ATTRIBUTE_VALUE parameter specified differs from the attribute named in the ATTRIBUTE parameter. In this case the NAME attribute is displayed in a list box, while the value returned when the form is submitted is the ADDRESS attribute.
Webject
<form>
<ie:webject name="Display-Selection" type="DSP">
  <ie:param name="ATTRIBUTE" data="NAME"/>
  <ie:param name="ATTRIBUTE_VALUE" data="ADDRESS"/>
</ie:webject>
</form>
Output
Generated HTML
<form>
<select name='ADDRESS'>
<option value='1234 Main St.'>Sam Johnson</option>
<option value='1234 Amber St.'>Harvy Anderson</option>
<option value='775 Main St.'>James O'Connor</option>
<option value='775 Main St.'>Harvey Hampton</option>
</select>
</form>
DISPLAY MULTIPLE ATTRIBUTES WITH SEPARATOR
Webject
<form>
<ie:webject name="Display-Selection" type="DSP">
  <ie:param name="ATTRIBUTE_VALUE" data="ADDRESS"/>
  <ie:param name="LEADER" data = ", "/>
  <ie:param name="SIZE" data="6"/>
</ie:webject>
</form>
Output
Generated HTML
<form>
<select name='ADDRESS' size=6>
<option value='1234 Main St.'>Sam Johnson, 1234 Main St.,
                                sjohnson@somewhere.com</option>
<option value='1234 Amber St.'>Harvy Anderson, 1234 Amber St.,
                               handerson@somewhere.com</option>
<option value='775 Main St.'>James O'Connor, 775 Main St.,
                                                      </option>
<option value='775 Main St.'>Harvey Hampton, 775 Main St.,
                                hhampton@somewhere.com</option>
</select>
</form>
DISPLAY MULTIPLE ATTRIBUTES WITH SEPARATOR AND WIDTHS
Webject
<ie:webject name="Display-Selection" type="DSP">
  <ie:param name="ATTRIBUTE_VALUE" data="ADDRESS"/>
  <ie:param name="LEADER" data = "_"/>
  <ie:param name="WIDTH" data="20"/>
  <ie:param name="WIDTH" data="20"/>
  <ie:param name="WIDTH" data="20"/>
  <ie:param name="SIZE" data="6"/>
</ie:webject>
</form>
Output
* 
Each attribute is padded with the LEADER to meet or exceed the specified WIDTH.
Generated HTML
<form>
<select name='ADDRESS' size=6>
<option value='1234 Main St.'>Sam Johnson_________1234 Main
                      St._______sjohnson@somewhere.com</option>
<option value='1234 Amber St.'>Harvy Anderson______1234 Amber
                      St.______handerson@somewhere.com</option>
<option value='775 Main St.'>James O'Connor______775 Main
                       St.____________________________</option>
<option value='775 Main St.'>Harvey Hampton______775 Main
                     St.________hhampton@somewhere.com</option>
</select>
</form>
DISPLAY SINGLE ATTRIBUTE WITH CONSTANT VALUE
Webject
<form>
<ie:webject name="Display-Selection" type="DSP">
  <ie:param name="ATTRIBUTE" data="NAME"/>
  <ie:param name="ATTRIBUTE_VALUE" data="ADDRESS"/>
  <ie:param name="LIST_HEADER" data="All Employees"/>
  <ie:param name="LIST_HEADER_VALUE" data="*"/>
  <ie:param name="SIZE" data="6"/>
</ie:webject>
</form>
Output
Generated HTML
<form>
<select name='ADDRESS' size=6>
<option value='*'>All Employees</option>
<option value='1234 Main St.'>Sam Johnson</option>
<option value='1234 Amber St.'>Harvy Anderson</option>
<option value='775 Main St.'>James O'Connor</option>
<option value='775 Main St.'>Harvey Hampton</option>
</select>
</form>
DISPLAY SINGLE ATTRIBUTE WITH MULTIPLE CONSTANT VALUES
Webject
<form>
<ie:webject name="Display-Selection" type="DSP">
  <ie:param name="ATTRIBUTE" data="NAME"/>
  <ie:param name="ATTRIBUTE_VALUE" data="ADDRESS"/>
  <ie:param name="LIST_HEADER" data="All Employees,No
                                         Employees" delim=","/>
  <ie:param name="LIST_HEADER_VALUE" data="*,-" delim=","/>
  <ie:param name="SIZE" data="6"/>
</ie:webject>
</form>
Output
Generated HTML
<form>
<select name='ADDRESS' size=6>
<option value='*'>All Employees</option>
<option value='-'>No Employees</option>
<option value='1234 Main St.'>Sam Johnson</option>
<option value='1234 Amber St.'>Harvy Anderson</option>
<option value='775 Main St.'>James O'Connor</option>
<option value='775 Main St.'>Harvey Hampton</option>
</select>
</form>
DISPLAY SINGLE ATTRIBUTE WITH PRE-SELECTED OPTION
Webject
<form>
<ie:webject name="Display-Selection" type="DSP">
  <ie:param name="ATTRIBUTE" data="ADDRESS"/>
  <ie:param name="SIZE" data="6"/>
  <ie:param name="SELECTED" data="1234 Amber ST."/>
</ie:webject>
</form>
Output
Generated HTML
<form>
<select name='ADDRESS' size=6>
<option value='1234 Main St.'>1234 Main St.</option>
<option selected value='1234 Amber St.'>1234 Amber St.</option>
<option value='775 Main St.'>775 Main St.</option>
<option value='775 Main St.'>775 Main St.</option>
</select>
</form>
DISPLAY SINGLE ATTRIBUTE WITH ALL OPTIONS PRE-SELECTED
Webject
<form>
<ie:webject name="Display-Selection" type="DSP">
  <ie:param name="ATTRIBUTE" data="ADDRESS"/>
  <ie:param name="SIZE" data="6"/>
  <ie:param name="SELECTED" data="*"/>
  <ie:param name="MULTIPLE" data="TRUE"/>
</ie:webject>
</form>
Output
Generated HTML
<form>
<select name='ADDRESS' size=6 multiple>
<option selected value='1234 Main St.'>1234 Main St.</option>
<option selected value='1234 Amber St.'>1234 Amber St.</option>
<option selected value='775 Main St.'>775 Main St.</option>
<option selected value='775 Main St.'>775 Main St.</option>
</select>
</form>