Advanced Customization > Info*Engine User’s Guide > Display Webject Reference > Display Webjects for HTML > Display-Object
  
Display-Object
DESCRIPTION
Displays a group of objects in a general way, allowing the insertion of markup language before and after objects and attributes. If the BORDER parameter is not specified, no formatting is done. If BORDER is specified, a simple table is generated.
SYNTAX
<ie:webject name=" Display-Object" type="DSP">
  <ie:param name="ATTRIBUTE" data="attribute"/>
  <ie:param name="ATTRIBUTE_SEPARATOR" data="separator"/>
  <ie:param name="BORDER" data="[pixels | 1]"/>
  <ie:param name="CAPTION" data="text"/>
  <ie:param name="CELLPADDING" data="pixels"/>
  <ie:param name="CELLSPACING" data="pixels"/>
  <ie:param name="DISPLAY_ATTRIBUTE_NAME" data="[TRUE |
                                                      FALSE]"/>
  <ie:param name="DISPLAY_ATTRIBUTE_VALUE" data="[TRUE |
                                                      FALSE]"/>
  <ie:param name="FOOTER" data="text"/>
  <ie:param name="GROUP_IN" data="group_name"/>
  <ie:param name="HEADER_SEPARATOR" data="separator"/>
  <ie:param name="MAX" data="maximum"/>
  <ie:param name="OBJECT_SEPARATOR" data="separator"/>
  <ie:param name="POST_ATTRIBUTE_NAME_TEXT" data="text"/>
  <ie:param name="POST_ATTRIBUTE_TEXT" data="text"/>
  <ie:param name="POST_CAPTION_TEXT" data="text"/>
  <ie:param name="POST_FOOTER_TEXT" data="text"/>
  <ie:param name="POST_HEADER_TEXT" data="text"/>
  <ie:param name="POST_OBJECT_TEXT" data="text"/>
  <ie:param name="POST_TABLE_TEXT" data="text"/>
  <ie:param name="POST_TITLE_TEXT" data="text"/>
  <ie:param name="POST_VALUE_TEXT" data="text"/>
  <ie:param name="PRE_ATTRIBUTE_NAME_TEXT" data="text"/>
  <ie:param name="PRE_ATTRIBUTE_TEXT" data="text"/>
  <ie:param name="PRE_CAPTION_TEXT" data="text"/>
  <ie:param name="PRE_FOOTER_TEXT" data="text"/>
  <ie:param name="PRE_HEADER_TEXT" data="text"/>
  <ie:param name="PRE_OBJECT_TEXT" data="text"/>
  <ie:param name="PRE_TABLE_TEXT" data="text"/>
  <ie:param name="PRE_TITLE_TEXT" data="text"/>
  <ie:param name="PRE_VALUE_TEXT" data="text"/>
  <ie:param name="START" data="starting_element"/>
  <ie:param name="TITLE" data="text"/>
  <ie:param name="UNDEFINED" data="string"/>
  <ie:param name="VALUE_SEPARATOR" data="separator"/>
</ie:webject>
PARAMETERS
* 
All parameters are optional.
ATTRIBUTE
Specifies which attributes are shown as each object is displayed. For this webject, you can specify two types of attributes: actual attributes and pseudo-attributes.
Actual attributes are explicitly stated as the value of the parameter. For example, specifying data="ename" includes the “ename” attribute when the object is displayed. Actual attribute values are always displayed.
Pseudo-attributes, unlike actual attributes, are usually obtained from a previous WML card. They often look like this in a webject:
data="$(attribute)"
A pseudo-attribute value can be a combination of text and variable references. Variable substitution is made from the attributes on the current object. For example, assume that the group named in the GROUP_IN parameter contains the two objects: name=Sam sal=200 and name=Chen sal=300. Then, the parameter:
<ie:param name="ATTRIBUTE" data="Employee $(name) is paid $(sal)"/>
generates the display text:
Employee Sam is paid 200
Employee Chen is paid 300
Notice the double quotation marks around the value of the parameter shown previously. These quotes indicate that the values of the parameter should be HTML-encoded to allow for any special characters to be properly rendered in the wireless device during display. Single quotes around the outside of the value could also have been used. If double quotes are to be used within the value for a parameter, use single quotation marks around the outside of the value. If single quotations (for example, an apostrophe) are to be used within the value for a parameter, use double quotation marks around the outside of the value.
For example, to generate the following name:
NAME='Sam Johnson';
either of the following parameter combinations would be correct in the Display-Object webject:
<ie:param name="ATTRIBUTE" data="NAME
                  =&#39;$(namecode)&#39;"/>

<ie:param name="ATTRIBUTE" data="NAME='$(NAME)';"/>
This parameter must be specified if DISPLAY_ATTRIBUTE_NAME is to be used. The default for this parameter is to display all attributes for each object. Multiple values can be specified for this parameter. This parameter is optional.
ATTRIBUTE_SEPARATOR
Specifies the text or HTML to be used between attributes. When there is a border, the default for this parameter is \n; when there is no border, the default is "". This parameter is optional.
BORDER
Determines the width, in pixels, of the HTML table border around the group of information to be displayed.
If the BORDER parameter is specified with a value other than "", HTML table tags are generated by default using other parameters. The default settings display objects as rows in a table and display attributes as columns in a table.
The following table shows the default values of the parameters that are affected by whether or not there is a border specified. There are two sets of defaults:
Defaults when there is a border (BORDER is specified with a value other than "").
Defaults when there is no border (BORDER is not specified or is set to "").
Parameter
HTML Default Value Used with a Border
HTML Default Value Used with No Border
PRE_TABLE_TEXT
POST_TABLE_TEXT
"<table border=BORDER cellspacing=CELLSPACING cellpadding=CELLPADDING>\n""</table>\n"
""""
PRE_HEADER_TEXT
HEADER_SEPARATOR
POST_HEADER_TEXT
"<th>""""</th>"
""""""
PRE_OBJECT_TEXT
POST_OBJECT_TEXT
"<tr>""</tr>\n"
""""
PRE_ATTRIBUTE_TEXT
POST_ATTRIBUTE_TEXT
"<td>""</td>"
""""
PRE_CAPTION_TEXT
POST_CAPTION_TEXT
"<caption>""</caption>\n"
""""
VALUE_SEPARATOR
ATTRIBUTE_SEPARATOR
OBJECT_SEPARATOR
"<br>""\n""\n"
""""""
PRE_TITLE_TEXT
TITLE
POST_TITLE_TEXT
"""""\n"
""""""
The default value of BORDER is "". Default values for parameters affected by whether or not there is a border can be overridden by explicitly setting the parameters. This parameter is optional.
CAPTION
Specifies the text for a table caption. The default for this parameter is "". This parameter is optional.
CELLPADDING
Specifies the amount of space, in pixels, between the border of a cell and its contents. The default for this parameter is "". This parameter is optional.
CELLSPACING
Specifies the amount of space, in pixels, around the outside of the cells in a table and between the cells in a table. The default for this parameter is "". This parameter is optional.
DISPLAY_ATTRIBUTE_NAME
Determines if the attribute name is shown. This parameter only applies if specific attributes are specified on an ATTRIBUTE parameter. The default for this parameter is FALSE. Use TRUE to enable. This parameter is optional.
DISPLAY_ATTRIBUTE_VALUE
Determines if the attribute value is shown. The default for this parameter is TRUE. Use FALSE to disable. This parameter is optional.
FOOTER
Specifies the text for a table footer. The default for this parameter is "". 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. For further information about groups, see Info*Engine Data Management.
The default for this parameter is to use the last group defined in the VDB. This parameter is optional.
HEADER_SEPARATOR
Specifies the text or HTML to be used between column headers. The default for this parameter is "". This parameter is optional.
MAX
Defines the maximum number of elements to display. Specifying a value for this parameter controls how much data is returned through the webject.
By using parameter value substitution for the MAX and START parameters, a series of webjects can be coded that allow data in any group to be displayed in manageable result sets. For more information, see Dynamic Parameter Value Substitution.
The default for this parameter is to display all remaining elements in the group, starting with the element identified in the START parameter. This parameter is optional.
OBJECT_SEPARATOR
Specifies the text or HTML to be used between table rows. When there is a border, the default for this parameter is \n; when there is no border, the default is "". This parameter is optional.
POST_ATTRIBUTE_NAME_TEXT
Specifies the text or HTML generated after each attribute name. The default for this parameter is </b>. This parameter is optional.
POST_ATTRIBUTE_TEXT
Specifies the text or HTML generated after each attribute value. When there is a border, the default for this parameter is </td>; when there is no border, the default is "". This parameter is optional.
POST_CAPTION_TEXT
Specifies the text or HTML generated after each caption. When there is a border, the default for this parameter is </caption>\n; when there is no border, the default is "". This parameter is optional.
POST_FOOTER_TEXT
Specifies the text or HTML generated after a table footer. The default for this parameter is \n. This parameter is optional.
POST_HEADER_TEXT
Specifies the text or HTML generated after each column header. When there is a border, the default for this parameter is </th>; when there is no border, the default is "". This parameter is optional.
POST_OBJECT_TEXT
Specifies the text or HTML generated after each object. When there is a border, the default for this parameter is </tr>\n; when there is no border, the default is "". This parameter is optional.
POST_TABLE_TEXT
Specifies the text or HTML generated after each group of objects. When there is a border, the default for this parameter is </table>\n; when there is no border, the default is \n</pre>\n . This parameter is optional.
POST_TITLE_TEXT
Specifies the text or HTML generated after a title. When there is a border, the default for this parameter is \n; when there is no border, the default is "". This parameter is optional.
POST_VALUE_TEXT
Specifies the text or HTML generated after each value of a multi-valued attribute. The default for this parameter is "". This parameter is optional.
PRE_ATTRIBUTE_NAME_TEXT
Specifies the text or HTML generated before each attribute name. The default for this parameter is <b>. This parameter is optional.
PRE_ATTRIBUTE_TEXT
Specifies the text or HTML generated before each attribute value. When there is a border, the default for this parameter is <tr>; when there is no border, the default is "". This parameter is optional.
PRE_CAPTION_TEXT
Specifies the text or HTML generated before each caption. When there is a border, the default for this parameter is <caption>; when there is no border, the default is "". This parameter is optional.
PRE_FOOTER_TEXT
Specifies the text or HTML generated before a table footer. The default for this parameter is "". This parameter is optional.
PRE_HEADER_TEXT
Specifies the text or HTML generated before each column header. When there is a border, the default for this parameter is <th>; when there is no border, the default is "". This parameter is optional.
PRE_OBJECT_TEXT
Specifies the text or HTML generated before each object. When there is a border, the default for this parameter is <tr>; when there is no border, the default is "". This parameter is optional.
PRE_TABLE_TEXT
Specifies the text or HTML generated before each group of objects. When there is a border, the default for this parameter is <table border=BORDER cellspacing=CELLSPACING cellpadding=CELLPADDING>\n; when there is no border, the default is <pre>. This parameter is optional.
PRE_TITLE_TEXT
Specifies the text or HTML generated before a title. The default for this parameter is "". This parameter is optional.
PRE_VALUE_TEXT
Specifies the text or HTML generated before each value of a multi-valued attribute. The default for this parameter is "". This parameter is optional.
START
Specifies the number of the first element in the group to display. Use this parameter in conjunction with the MAX parameter to control how much data is returned through the webject.
By using parameter value substitution for the MAX and START parameters, a series of webjects can be coded that allow data in any group to be displayed in manageable result sets. For more information, see Dynamic Parameter Value Substitution.
The default for this parameter is to start with the first record in the group. This parameter is optional.
TITLE
Specifies the text for a title. The default for this parameter is "". This parameter is optional.
VALUE_SEPARATOR
Specifies the text or HTML to be used between values of attributes if the table contains multi-valued attributes. When there is a border, the default for this parameter is <br>; when there is no border, the default is “,”. This parameter is optional.
UNDEFINED
Sets the value to display for an undefined value. An undefined value is either a nonexistent attribute or an attribute that has a null value. An attribute containing an empty string ("") is not interpreted as being undefined. The default for this parameter is "". This parameter is optional.
EXAMPLES
The following Display-Object webject examples assume an input group containing multiple elements; each with a name, address and email attribute value:
DEFAULT DISPLAY
Webject
<ie:webject name="Display-Object" type="DSP"/>
Output
COMMA SEPARATED LIST OF ALL ATTRIBUTES
Webject
<ie:webject name="Display-Object" type="DSP">
  <ie:param name="ATTRIBUTE_SEPARATOR" data=","/>
</ie:webject>
Output
COMMA SEPARATED LIST OF SOME ATTRIBUTES, ONE ELEMENT PER LINE
Webject
<ie:webject name="Display-Object" type="DSP">
  <ie:param name="ATTRIBUTE" data="name,address" delim=","/>
  <ie:param name="ATTRIBUTE_SEPARATOR" data=","/>
  <ie:param name="OBJECT_SEPARATOR" data="<br>"/>
</ie:webject>
Output
FREE-FORM SUBSTITUTION, ONE ELEMENT PER LINE
Webject
<ie:webject name="Display-Object" type="DSP">
  <ie:param name="ATTRIBUTE" data="Employee $[name] lives at
                                           $[ADDRESS] &amp;"/>
  <ie:param name="ATTRIBUTE" data="$[NAME]'s email address is
                                            &lt;$[email]&gt;"/>
  <ie:param name="ATTRIBUTE_SEPARATOR" data=" "/>
  <ie:param name="OBJECT_SEPARATOR" data="<br>"/>
</ie:webject>
Output
ESCAPE CHARACTERS
Webject
<ie:webject name="Display-Object" type="DSP">
  <ie:param name="ATTRIBUTE" data="User's <name> = $[EMAIL]"/>
  <ie:param name="OBJECT_SEPARATOR" data="<br>"/>
</ie:webject>
* 
Output displays with no <name> because the < and > signs are interpreted as HTML tags. If "<" and ">" are desired in the output, use the special characters &lt and &gt.
Output
* 
View source to verify unquoted < and > characters.
Generated HTML
User's <name> = sjohnson@somewhere.com<br>
User's <name> = handerson@somewhere.com<br>
User's <name> = <br>
User's <name> = hhampton@somewhere.com
DEFAULT TABLE
Webject
<ie:webject name="Display-Object" type="DSP">
  <ie:param name="BORDER" data="1"/>
</ie:webject>
Output
DISPLAY TABLE WITH TITLE AND CAPTION
Webject
<ie:webject name="Display-Object" type="DSP">
  <ie:param name="BORDER" data="1"/>
  <ie:param name="DISPLAY_ATTRIBUTE_NAME" data="TRUE"/>
  <ie:param name="CAPTION" data="The table caption"/>
  <ie:param name="PRE_TITLE_TEXT" data="<b><i>"/>
  <ie:param name="TITLE" data="The table title"/>
  <ie:param name="POST_TITLE_TEXT" data="</i></b>"/>
</ie:webject>
Output
JAVASCRIPT
The following example shows how JavaScript can be incorporated into the Display-Object webject.
Webject
<script> var itemcnt=0; </script>
<table border=0 cellspacing=0 cellpadding=0>
   <th bgcolor=yellow align=left> &nbsp; </th>
   <th bgcolor=yellow align=left> Name </th>
   <th bgcolor=yellow align=left> &nbsp; </th>
   <th bgcolor=yellow align=left> Email </th>
   <th bgcolor=yellow align=left> &nbsp; </th>
  <ie:webject name="Display-Object" type="DSP">
    <ie:param name="PRE_OBJECT_TEXT" data="<script> itemcnt++;
                   if (itemcnt % 2 == 0) document.write('<tr
                   bgcolor=#FFFFFF>'); else document.write('<tr
                   bgcolor=#D3D3D3>'); </script>"/>
    <ie:param name="ATTRIBUTE" data="<td width=10>
                   &nbsp; </td>"/>
    <ie:param name="ATTRIBUTE" data="<td align=left
                   valign=middle> <input type=radio
                   name=rowid>$[NAME]</td>"/>
    <ie:param name="ATTRIBUTE" data="<td width=25>
                   &nbsp; </td>"/>
    <ie:param name="ATTRIBUTE" data="<td align=left
                   valign=middle>$[EMAIL]</td>"/>
    <ie:param name="ATTRIBUTE" data="<td width=25>
                   &nbsp; </td>"/>
    <ie:param name="POST_OBJECT_TEXT" data="</tr>"/>
  </ie:webject>
</table>
Output