Sun Java logo     Previous      Contents      Next     

Sun logo
Sun Java System Identity Manager 6.0 Workflows, Forms, and Views 2005Q4M3  


HTML Display Components

This chapter describes the Identity Manager HTML display component library. HTML display components are used when customizing forms. See Forms for a discussion of the larger topic of customizing forms.

HTML Component

If you are designing forms, you will use the HTML components described in this section. To create a form, you can use the Identity Manager Form XML language (also called forms), to describe HTML display components. This language is then interpreted at runtime to build the necessary components. It allows new pages to be dynamically generated with little or no additional Java development, which greatly simplifies customization.

This section covers the following topics:

What Are HTML Components?

HTML display components are instances of Java classes that generate a string of HTML text. Each display component has:

Specifying Display Components

You can specify display components as follows:

<Field name='Name'>

   <Display class='Class'>

      <Property name='Name' value='Value'/>



Component Classes

HTML components are independent objects that can be combined in various ways. Related components are organized into classes. There are two major groups of component classes:

Basic Component Classes

Common component classes include the components that are used to display and edit a single value. These components are defined in the section titled Basic Components.

Container Classes

A container class defines a collection of components that are visually organized in a certain way. Typically, creating a container class results in the generation of an HTML table tag. Simple containers can concatenate the components horizontally or vertically. Other containers allow more flexible positioning of components and may add ornamentation around the components.

Since containers are themselves components, any container can be placed inside another container. You can use this mechanism to build complex page layouts. For example, many pages consist of a title, followed by a list of editing fields, followed by a row of form submission buttons. You can create this by creating a Panel component using vertical orientation that contains a Label component, an EditForm component, and a ButtonRow component. The EditForm component itself contains some number of subcomponents. The ButtonRow component is simply a Panel that uses horizontal orientation and contains a list of Button components.


Defines five regions (north, south, east, west, and center) into which items can be placed. Components in the north and south regions are positioned horizontally. Components in all other regions are positioned vertically.

Properties include:


Sets default options for button placement. Extends the Panel component.


This display component is the default display class used to render forms in a browser.

Form components are positioned in two columns, with titles on the left, and components on the right. Flyover help can be included with the titles. Multiple components can be concatenated on a single row.

Most commonly edited properties include title, subTitle and adjacentTitleWidth.

<Form name='Default User Form' help='account/modify-help.xml'>

   <Display class='EditForm'>

     <Property name='titleWidth' value='120'>

     <Property name='adjacentTitleWidth' value='60'>


Additional EditForm properties include:


The most basic container. Panel renders its children in a simple linear list.

Properties include:

The default orientation is vertical, but can be set horizontal.


Arranges components in a grid with an optional row of column titles at the top.

Properties include:


Use to render a tabbed panel that displays a row of tabs as shown below. By default, the tabs are aligned horizontally.

Properties include:


Used to create a Panel capable of horizontal alignment.


Use to create a table whose contents can be sorted by column header.

Properties include:


Use to render one of several child components (typically EditForms) that use wizard-style Next and Previous buttons to navigate between components.

Properties include:

Page Processor Requirements for HTML Components

This section describes the page processor requirements to display forms that implement HTML components.

Hidden Parameters

Most components have a name that corresponds to the name of a parameter posted from an HTML form. Identity Manager reserves a few parameter names for general use. Do not use these names as component names.

Reserved Name



Contains the ID of the object being edited


Contains the value of the button used to submit the form


Contains the name of the last component that was active on the form


Can contain an informational message to be displayed at the top of the page


Can contain an error message to be displayed at the top of the page

Component Subclasses

All components extend the Component class, which defines the properties common to most components. In addition, some components extend the Container class, which gives them the ability to contain other components.

Each Component subclass defines a number of properties that are used to specify the characteristics of the component beyond those implied by the Component base class. For example, the Label component supports a font property, which can be used to specify the font used when rendering the label.

Naming Conventions

Properties always begin with a lowercase letter and use camel case to separate adjacent words. Access method names are formed by capitalizing the property name, and prefixing either get or set. For example, the property named font is accessible from Java using the following methods:

The data type for each property varies and is documented with the property. the terminology used to describe property value types is described in the following table.

Data Types

This table lists the data types allowed in component properties.




Indicates that a property has no value


Represents the most common data type. String values are usually represented by an instance of the Java String class. Some components are values of any class. These are implicitly coerced to strings with the toString method.

Unless otherwise specified, you can assume that all properties are of type string.

Example <String>Hello World</String>

List of string

Indicates that the value is expected to be a list of one or more strings. In Java, this value is always implemented as an instance of the List class. The elements of the list are then expected to be instances of the String class.



   <String>choice one</String>

   <String>choice two</String>


comma list

Represents a single string that contains character ranges separated by a comma character. Components that have multivalued properties typically allow either list of string values or comma list values. When a comma list is assigned to a property, the component converts it to a list of strings by extracting the substrings between commas and adding them to a list in the order in which they appear in the string.


Represents a logically true or false value. Many properties require Boolean values.

A Boolean value can be represented several ways. false represents one of the following values:

  • a null value
  • a Boolean object whose value is false
  • an Integer object whose value is 0
  • A string whose value is anything other than true.

When defining components in XML, Boolean values are most often represented with the strings true and false. (Any string value other than true is considered false.)


Represents a positive or negative integer. int properties are commonly specified using strings. In that case, the string is coerced to an integer using the usual rules. If a string contains invalid integer characters, the coerced value is zero.

Base Component Class

The Component class is the base class for all HTML components. It contains the properties that are common to most components. Not all Component properties are relevant in every subclass. For example, Component defines a property allowedValues that can contain a list of value constraints. This property is relevant only in subclasses that allow value editing such as Select or MultiSelect. Further, Container classes almost never directly represent an editable value. Consequently, any properties related to the component value are irrelevant. Some properties are relevant only if the component is contained within a specific Container class.


Specifies the internal name of a field. All editing components must have a name, which is typically unique among all components displayed on the page. name is a string that is usually a path to a view attribute.

Container components do not require names and any assigned names are ignored. When building components from Java, component names are defined by the application. When building components from XML forms, component names are derived from the names of Field elements in the form. Field names are in turn path expressions within the view object that is used with the form.


<Field name ='global.firstname'>

For more information on how the name attribute refers to a specific attribute in the user view, see Views.


(Optional) Specifies the external name of a field. Titles are typically used with the EditForm container, which builds an HTML table that contains titles in one column and components in another.

Components do not render their own titles. Rendering of titles is controlled by the container. Many containers ignore titles.


<Property name='title' value='FirstName'/>

<Property name='title'>



         <s>Edit User: </s>





In this example, the field title is in part derived dynamically from the user’s Identity Manager account ID.


Editing components have a value that may be null. The value is typically set automatically by Identity Manager from an attribute in a view. Some components allow you to set the value by explicitly ignoring current view content. This value can be null.

The Component class allows the value to be any Java object. The subclass must coerce the value to a particular type when it is assigned, or when the HTML is generated. Component values are almost always String objects or List objects that contain strings. See the section titled Data Types for more information on component value types.

Most container classes do not have values. If you assign a value, it is ignored. Some containers do allow values (for example, TabPanel and WizardPanel).

When building components from XML forms, the value is usually derived by using the component name as a path into the underlying view object, which contains all the values being edited.


<Property name= 'value' value='false '/>


Specifies an optional list of allowed values for the component. If specified, the component allows you to select from only values that are on the list. If the component supports value restrictions, the list of allowed values is stored here. The value is always a list and usually contains strings. For convenience when setting properties from XML forms, you can also specify the allowed values as a comma list.

For more information on using this property to populate lists, see the section titled Lists.


<Property name='allowedValues' value= 'Mon, Tue, Wed, Thurs, Fri'/>

<Property name='allowedValues'/>


      <call name='DaysoftheWeek'/>




This property is recognized only by the SortingTable container. The SortingTable container organizes components into a table with each column expected to contain components of the same class. SortingTable allows the rows to be sorted according to the values in any column. Typically, the sort order is determined from the value of each component in the column. There may be cases, however, where the value of the component is not suitable for sorting or may be inefficient to compare. In these cases, you can specify an alternate numeric sorting key.


If true, indicates that the field is expected to have a value before the form is submitted. If the component is contained within an EditForm, a red * (asterisk) will be placed after the component to indicate that the user must enter a value before saving. If the required schema map attribute is selected, (that is, set to a value of true), the field is always required.

The value of the property must be either true or false.


<Property name='required ' value='true '/>


If true, the field displays on the Identity Manager page next to the previous field. If not specified or set to false, the field appears on a new line, directly under the previous field. The default value is false

This Boolean property is recognized only if the field is contained in a form that uses the EditForm display class. Typically, EditForm renders each component on a new row with the titles aligned in the left column and the component in the right column. To conserve space, you can concatenate several components on the same row. If the component also has a title, the title is rendered as non-highlighted text between the previous component and this component.

Values include:

value='true ' | 'false '


<Property name='noNewRow ' value='true '/>


Use if the container defines more than one display area and the component must be added to a specific area. Some containers allow the placement of components to be controlled by assigning a value to the location property. For example, the BorderedPanel container supports five different display areas: north, south, east, west, and center.

The recognized values for the location property are defined by the container. If you do not assign a location, or assign a location name that is not recognized, the container places the component in the default location.


Specifies text that may be displayed to assist the user in understanding purpose of the field. In most Identity Manager pages, this will cause the <icon> icon to be displayed next to the component title. Moving the mouse over this icon will cause the help text to be displayed in the left margin.

The value of the property can either be literal text to be displayed, or it can be a message catalog key. Literal text can include HTML markup.

For more information on adding help to your custom form, see Adding Guidance Help to Your Form in the chapter titled Forms.


Specifies the text that can be rendered beneath a component in Identity Manager pages.

The value of the property can either be literal text to be displayed, or it can be a message catalog key. Literal text can include HTML markup.


Specifies a command to submit when a component is modified. (When a user makes a change to a value, form output is recalculated.)

This property is typically used with the Button component. Some components must cause immediate submission of the surrounding HTML form when they are modified so that the application can regenerate the page based on that modification. Setting the command property to a non-null value causes this behavior.

When the command property is set, and the component is modified, the form is posted and an extra hidden parameter named command is posted whose value is the value of the command property.

The command specifies how the system will process the edits that have been made to a view. The command property must have one of the following values.




Causes the edits to be saved.


Causes the edits to be discarded.


Causes the page to be regenerated.


Causes the edits to be saved, but no form validation to be performed.

Since specifying a command value of Recalculate is so common in forms, an shorter alterative syntax is available. The Display element has an attribute named action that when set to true, has the same effect as setting the command property to Recalculate.

<Display class='Select' action='true'>"


When specified, the value is expected to contain JavaScript that will be assigned as the value of the onClick attribute of the input element generated for this component. Not all components support the onClick property.

Use of this property is rare and requires detailed knowledge of the generated HTML. If you use this property, the page must typically contain a Javascript component that defines JavaScript functions you call from within the onClick value.


<Property name='onClick' value="Uncheck(this.form, 'resourceAccounts.selectAll');"/>

Note  Once forms are stored in the repository, Identity Manager always uses single quotes to surround attribute values. If single quotes appear within the attribute value, they will be replaced with &#039;. To prevent this escaping you can represent the string in an XPRESS s expression:

<Property name='onClick'>

   <s>Uncheck(this.form, 'resourceAccounts.selectAll'); </s>



Similar to command. The value can be an arbitrary JavaScript statement to run when the field is modified.

Not all components support the onChange property.

Use of this property is rare and requires detailed knowledge of the generated HTML. If you use this property, the page must typically contain a Javascript component that defines JavaScript functions you call from within the onChange value.

nowrap, align, width, valign, and colspan

Most containers position subcomponents by surrounding them with an HTML table tag. The HTML generated for each component then is typically contained in a td tag. Some containers can recognize the nowrap, align, width, and colspan properties and use them when generating the surrounding table cell tag. You can use these components to adjust the position and size of the component within the container.


<Property name= 'width' value='3'/>

<Field name='Start Day' prompt='Day' nowrap='true'/>

Basic Components


Displays a link that returns to the previous page. The behavior of this component is the same as that of the browser Back button. However, you may want to place this link in a convenient position on the page.

  Properties for this display component:


<Field name='back'>

   <Display class='BackLink'>

      <Property name='value' value='previous page'/>




Displays a button. Buttons typically submit the surrounding form, but they can also be defined to run arbitrary JavaScript.

Properties for this display component are:


<Display class='Button'>

   <Property name='label' value='Change Password'/>

   <Property name='value' value='Recalculate'/>



Displays a checkbox. When checked, the box represents a value of true. An unselected box represents a false value.

Properties for this display component are:


<Field name='accounts[NT].passwordExpired'>

   <Display class='Checkbox'>

      <Property name='title 'value='Password is Expired'/>




Allows the user to specify a date using an applet that displays a calendar. The field is displayed in the form as a calendar icon. When the icon is clicked, the calendar applet is launched in a separate window.

  Properties include:


<Field name='ExpireDate'>

   <Display class='DatePicker'>

      <Property name='title' value='Set Password Expire date'/>

      <Property name='format'= value='iso'/>




Displays a text field and a Browse button that allows the user to select a file and upload it to the server. Use this component to import data into Identity Manager from a file (such as users or configuration objects). This component supports all the properties that the Text component supports.


Describes the root HTML page. This component can contain arbitrary HTML and browser JavaScript. Properties include:


Use to insert pre-formatted JavaScript into the page. This is useful if you are using the onClick or onChange properties in components and want to call custom JavaScript functions.

Though not required, it is recommended that you specify the name property when building components from XML forms. Using features such as field loops and field inclusion, you can add more than one JavaScript component containing the same script to the page. During HTML generation, JavaScript components that have the same name are included only once.

The component has an extended property named script that can contain the JavaScript text.

You can also include JavaScript by setting the property named source. This should be a string containing a URL fragment relative to the base context. It is the JavaScript contained in the indicated file to be loaded by the browser.


Displays a string of text.

Properties for this display component are:



   <Display class='Label'>

      <Property name='title' value='Account ID'/>

      <Property name='value'>






Places a link on the page.

Properties include:



   <Display class='Link'>

      <Property name='name' value='Request

            Group Access'/>

      <Property name='URL'


      <Property name='id' value='Group Request




Note  Link components are one place in your form where you might use a <map> element to pass name/value pairs. In the following example, the <map> element contains several pairs: a mapping of a String to a Boolean value and a String to a List.

<invoke class='com.waveset.ui.FormUtil'















Renders a bulleted list of links, resembling a menu.


A component that renders a collection of name/value pairs in a simple two column table. This component directly renders the data it contains.

Data can be specified in several forms:


Displays a multiselection text box, which displays as a two-part object in which a defined set of values in one box can be moved to a selected box. Values in the left box are defined by the allowedValues property, values are often obtained dynamically by calling a Java method such as FormUtil.getResources. The values displayed in the right side of a multiselection box are populated from the current value of the associated view attribute, which is identified through the field name.

The form titles for this two-part object are set through the availabletitle and selectedtitle properties.

If you want a MultiSelect that does not use an applet, set the noApplet property to true.

Note  If you are running Identity Manager on a system running the Safari browser, you must customize all forms containing MultiSelect components to set the noApplet option. Set this option as follows:

<Display class='MultiSelect'>

<Property name='noApplet' value='true'/>


Properties for this display component are:


<Field name='accounts[LDAP].LDAPDept' type='string'>

   <Display class='MultiSelect' action='true'>

      <Property name='title' value='LDAP Department'/>







             <String>International Sales</String>






Displays a horizontal list of one or more radio buttons. A user can select only one radio button at a time. If the component value is null or does not match any of the allowed values, no button is selected.

Properties for this display component are:


<Field name='attributes.accountLockExpiry.unit'>

   <Display class='Radio'>

     <Property name='noNewRow' value='true'/>

     <Property name='labels'>









     <Property name='allowedValues'>












Displays a new section heading defined by the value of the text property. It is an extension of the Label class that sets the font property to a style that results in large bold text. It also sets the pad property to zero to eliminate the default 2 space padding. Use it to break up long forms into sections separated by a prominent label.

The only property for this display component is text, which specifies the text to be displayed.



   <Display class='SectionHead'>

      <Property name='text' value ='Calculated Fields'/>




Displays a single-selection list box. Values for the list box must be supplied by the allowedValues property.

Properties for this display component are:


<Field name='city' type='string'>

   <Display class='Select'>

      <Property name='title' value='City'/>

      <Property name='allowedValues'>




            <String>New York</String>






Displays a regular text entry box.

Common properties for this display component are:


<Field name='variables.identityID'>

   <Display class='Text'>

      <Property name='required'>



      <Property name='title' value='Identity ID'/>

      <Property name='size' value='32'/>

      <Property name='maxLength' value='128'/>

      <Property name='submitOnEnter' value='Save'/>




Displays a multi-line text entry box.

Properties for this display component are:


To display a text box with five visible rows that wraps after each 70 characters specify:

<Field name='Description'>

   <Display class='TextArea'>

     <Property name='rows' value='5'/>

     <Property name='columns' value='70'/>



If the user enters text beyond the defined visible rows, the text area displays a scroll bar.

Previous      Contents      Next     

Copyright 2006 Sun Microsystems, Inc. All rights reserved.