Sun Java System Identity Manager 6.0 Workflows, Forms, and Views 2005Q4M3 |
8
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 ComponentIf 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:
- A class name (defined in the field by the class attribute of the Display element). This name identifies the component class, which determines the component’s fundamental behavior and defines the set of properties recognized by the component.
- One or more properties (defined in the field with Property elements). Properties further define field behavior and appearance.
Specifying Display Components
You can specify display components as follows:
<Field name='Name'>
<Display class='Class'>
<Property name='Name' value='Value'/>
</Display>
</Field>
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.
BorderedPanel
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:
ButtonRow
Sets default options for button placement. Extends the Panel component.
- pad – Specifies where to insert this space between the button row and an adjacent component. Allowed values are top and bottom. If the value is null, no space is added. Default value is top.
- divider – Specifies whether the divider should be rendered as a horizontal or blank line. When true, the divider will be rendered as a horizontal line (for example, an <hr>). (Boolean)
EditForm
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'>
</Display>
Additional EditForm properties include:
- adjacentTitleWidth – Specifies the width of the titles of adjacent fields. If this property is not defined, it defaults to zero. If you define adjacentTitleWidth as equal to zero, columns titles will automatically resize. If set to a non-zero value, then the title width of adjacent columns (for example, the second and third columns) will be the value of adjacentTitleWidth.
- componentTableWidth – Specifies the width (in pixels) of the EditForm. If not specified, this defaults to either 400 pixels or the value of the defaultComponentTableWidth global property for EditForm
- noAlternatingRowColors – Specifies whether rows in the EditForm are rendered in the same color. When noAlternatingRowColors is set to true, every row in the EditForm is rendered the same color. If not specified, this defaults to false.
Panel
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.
SimpleTable
Arranges components in a grid with an optional row of column titles at the top.
Properties include:
- columns – Defines the column headers. Usually a list of message keys, but can also be simple strings. (List)
- rows – Defines the cells of the table. Each cell must be a component. (List)
- columnCount – Specifies the number of columns if there is no column title list.
- border – Determines the width of the table border. Set to 0 to create invisible borders.
- noItemsMessage – Specifies the message to display in the table when there are no rows.
TabPanel
Use to render a tabbed panel that displays a row of tabs as shown below. By default, the tabs are aligned horizontally.
Properties include:
- leftTabs – When set to true, aligns tabs along left margin, not along the top. (Boolean)
- border – Draws a border around the main panel under the tabs, when set to true. (Boolean)
- renderTabsAsSelect – Renders tabs as a Select drop-down rather than tabs, when set to true. This is useful when a form contains many tabs that would cause the browser to scroll horizontally. Do not use in conjunction with aligning the tabs on the left.
- tabAlignment – Determines the position of the tabs relative to the page content. Valid values include left (default setting), top, right, bottom, center, and middle.
<Field name='MainTabs'>
<Display class='TabPanel'>
<Property name='leftTabs' value='false'/>
<Property name='tabAlignment' value='left'/>
</Field>
Row
Used to create a Panel capable of horizontal alignment.
SortingTable
Use to create a table whose contents can be sorted by column header.
Properties include:
- pageButtonAlign – Determines position of buttons relative to page content. Valid values include left, right, bottom, and center. The default value is right.
- sortEnable – Enables column sorting when set to true. (Boolean)
- sortURL – Identifies the URL that Identity Manager posts to when column sorting is selected. If column sorting is not set, Identity Manager uses the _postURL of the HtmlPage. (String)
- sortURLParams – Specifies the parameters that get passed along with the sortURL. (String)
- sortColumn – Specifies the number of the column that we are currently sorting by. The default is to set this value to the first column. (Integer)
- sortOrder – Specifies the sort order. Values includes asc (for ascending) or desc (for descending). Default value is asc. (String)
- linkEnable – Indicates if this table is to be generated with the first column as links. (Boolean)
- linkURL – Specifies the URL that Identity Manager links to when generating links. If not specified, defaults to the post URL of the containing HtmlPage. (String)
- linkURLArguments – Indicates the arguments to include in the link URL.
- linkColumn – Specifies the column number that will be used for the generated links as specified by the linkURL attribute. (Integer)
- linkParameter – Specifies the name of the post data parameter that will have the value of the link row id. The default value is id.
- selectEnable – Indicates whether a column of checkboxes is displayed along a multiselect table’s left margin. When set to true, Identity Manager displays a column of checkboxes. (Boolean)
- columns – Lists table column headers. (List of strings)
- pageSize – Specifies that the table should display at most _pageSize entries simultaneously. If more than _pageSize entries exist, then interface elements allow paging through the results. If _pageSize is less than 1 (the default setting), then all entries are displayed at once. (Integer)
- useSavedPage – If the value of pageSize exceeds 0, then the sorting table saves the current sorting table page on the HTTP session in the <fieldName>_currentPage attribute. The _useSavedPage property indicates whether the current page should be retrieved from the HTTP session and displayed. By making the value of this property the result of an XPRESS expression, the form or view can control when the current page is recalled after when returning back to the JSP containing the SortingTable component. (Boolean)
For example, if the SortingTable component displays the results of a query containing editable items, to ensure that Identity Manager displays the results page that contains the edited item after the user has edited an item in the result table, enter a value that exceeds 0.
WizardPanel
Use to render one of several child components (typically EditForms) that use wizard-style Next and Previous buttons to navigate between components.
Properties include:
- button – Specifies a value for child component's location property that will place it in the button row. (String)
- nextLabel – Specifies the label to display on the Next button. The default text is Next. (String)
- prevLabel – Specifies that the label in the Previous button is displayed. (String)
- cancelLabel – Specifies that the label in the Cancel button is displayed. (String)
- okLabel – Specifies that the label is displayed in the OK button. (String)
- noOk – Specifies that the OK button is not displayed. (Boolean)
- alwaysOk – Determines that the OK button is displayed, when set to true. (Boolean)
- noCancel – Specifies that the Cancel button is not displayed, when set to true. (Boolean)
- topButtons – Causes the buttons to be rendered at the top of the page rather than the page bottom, when set to true. (Boolean)
- noButtons – Suppresses all button rendering when set to true. (Boolean)
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.
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.
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.
name
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.
Example
<Field name ='global.firstname'>
For more information on how the name attribute refers to a specific attribute in the user view, see Views.
title
(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.
Examples
<Property name='title' value='FirstName'/>
<Property name='title'>
<expression>
<concat>
<s>Edit User: </s>
<ref>waveset.accountId</ref>
</concat>
</expression>
</Property>
In this example, the field title is in part derived dynamically from the user’s Identity Manager account ID.
value
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.
Example
<Property name= 'value' value='false '/>
allowedValues
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.
Example
<Property name='allowedValues' value= 'Mon, Tue, Wed, Thurs, Fri'/>
<Property name='allowedValues'/>
<expression>
<call name='DaysoftheWeek'/>
</expression>
</Property>
primaryKey
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.
required
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.
Example
<Property name='required ' value='true '/>
noNewRow
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 '
Example
<Property name='noNewRow ' value='true '/>
location
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.
help
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.
inlineHelp
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.
command
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.
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'>"
onClick
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.
Example
<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 '. To prevent this escaping you can represent the string in an XPRESS s expression:
<Property name='onClick'>
<s>Uncheck(this.form, 'resourceAccounts.selectAll'); </s>
</Property>"
onChange
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.
- nowrap – Specifies how some components are displayed if they contain a long string of text. If the value of nowrap is false or unspecified, the browser can break up the component text into multiple lines when it is displayed. If the value of noWrap is true, the browser will try to keep the component text on a single line.
- align – Rarely used. Adjusts the element horizontally on the form. Allowed values are left, right, and center.
- valign – Rarely used. Specifies where components are rendered vertically. Allowed values are top, bottom, and middle.
- colspan – Deprecated
Examples
<Property name= 'width' value='3'/>
<Field name='Start Day' prompt='Day' nowrap='true'/>
Basic Components
BackLink
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:
Example
<Field name='back'>
<Display class='BackLink'>
<Property name='value' value='previous page'/>
</Display>
</Field>
Button
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:
- name – Specifies the name of the parameter that will be posted when the user clicks this button. This property is optional; if not specified, the default value is command.
- value – Specifies the value of the parameter posted when the user clicks this button.
- label – Specifies the visible text that displays on the button.
- command – Specifies an optional value to submit along with the name parameter (for example, Save, Cancel, Recalculate).
- postURL – Specifies an alternate, target URL to which the form will be posted. This value overrides the URL specified in the JSP.
- hiddenID – Specifies an optional value for an id parameter to be included in the form post data.
Example
<Display class='Button'>
<Property name='label' value='Change Password'/>
<Property name='value' value='Recalculate'/>
</Display>
Checkbox
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:
- label – (Optional) Specifies a label that is displayed to the right of the checkbox. It is displayed adjacent to the component, but is not displayed in the title column
- leftLabel – Specifies that the label should appear to the left of the checkbox.
- checkAll – Set when this checkbox is serving as a select all checkbox, which should then propagate its value to a set of other checkboxes. The value of the property is a regular expression that is used to match the names of other checkboxes on the HTML page.
- uncheck – Set to the name of another checkbox field that represents the select all checkbox in a collection of synchronized checkboxes. If this is set, whenever the check status of this checkbox is changed, the select all checkbox is unchecked.
- syncCheck – Set to the name of another checkbox field that must stay in sync with the value of the checkbox field on which this property is set. If this is set, whenever the value of this checkbox is changed, the sync'ed checkbox's value is set to the same value.
- syncUncheck – Set to the name of another checkbox field that should stay in sync when the value of the checkbox field on which this property is set is changed to false. If this is set, whenever the value of this checkbox is changed to false, the sync'ed checkbox's value will also be set to false (unchecked).
- syncCheckAllTo – Indicates that all select-all checkboxes matching the regular expression will be kept in sync with the value of the checkbox field on which this property is set when its value is changed to false. The value of this property is a regular expression that represents one or more of the select-all checkboxes.
- syncUncheckAll – Set to the name of another checkbox field that should stay in sync when the value of the checkbox field on which this property is set is changed to false. If this is set, whenever the value of this checkbox is changed to false, the sync'ed checkbox's value will also be set to false (unchecked).
- syncCheckTo – Indicates that all checkboxes matching the regular expression will be kept in sync with the value of the checkbox field on which this property is set. Whenever the value of the checkbox field on which this property is set is changed, the sync'ed checkbox's value will be set to the same value. The value of the property is a regular expression.
- value – Determines the state of the checkbox. If the value is logically true, the checkmark appears.
Example
<Field name='accounts[NT].passwordExpired'>
<Display class='Checkbox'>
<Property name='title 'value='Password is Expired'/>
</Display>
</Field>
DatePicker
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:
- format – Specifies the date format to use for displaying the date. This can be a Java-style date formatting string that uses any of the following formatting characters: y, M, or d. This can also be the value iso, specifying ISO format (yyyy-MM-dd), or the value local, specifying a locale-sensitive format (the Java default for the locale). If omitted, the format "MM/dd/yyyy" will be used.
- multiField – Indicates whether separate input fields should be displayed for each element of the date. If omitted or false, a single text field will be used for input, expecting properly formatted date text.
- value – Specifies the date to be highlighted on the calendar as the current date. Date can be parsed from either a Date object or a String object.
Example
<Field name='ExpireDate'>
<Display class='DatePicker'>
<Property name='title' value='Set Password Expire date'/>
<Property name='format'= value='iso'/>
</Display>
</Field>
FileUpload
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.
Html
Describes the root HTML page. This component can contain arbitrary HTML and browser JavaScript. Properties include:
- commentScripts – Indicates whether <script> tags emitted for JavaScript should be enclosed in comments.
- title – Specifies the title of the page. Can be a String or Message, but typically is a String.
- postUrl – Specifies the URL that Identity Manager posts to when the main form is submitted.
- messages – Indicates which informational messages to display.
- comments – Indicates the special comments to include. This property is typically used by GenericEditForm and FormConverter when these methods catch exceptions.
- foccussedFieldName – Specifies the name of the first field to receive focus. Typically null. The value of this property is calculated as the first text field, or if no text fields, the first field.
- activeControl – Specifies the name of the last known active form field. (String)
Javascript
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.
Label
Displays a string of text.
Properties for this display component are:
- value – Defines the text to be displayed. The value can be either a string or a list of strings. When the value is a list, each string in the list is displayed on a separate line.
- leftPad – Specifies the number of spaces to insert to the left of the label.
- pad – Specifies the number of spaces to insert to the left and right of the label.
- rightPad – Specifies the number of spaces to insert to the right of the label.
Note If no padding is specified, the default padding is leftPad=2, rightPad=2.
Example
<Field>
<Display class='Label'>
<Property name='title' value='Account ID'/>
<Property name='value'>
<ref>waveset.accountId,/ref>
</Property>
</Display>
</Field>
Link
Places a link on the page.
Properties include:
- URL – Specifies the target Uniform Resource Locator (URL).
- imageURL – (Optional) Specifies the URL to an icon or image that will be rendered to the right of the link.
- imageURL2 – (Optional) Specifies the URL to an icon or image used will be rendered to the right of the first image.
- hoverText – Specifies text to display when the mouse rests over the first or second image.
- id – (Optional) Specifies a value to be included as the id query argument in the link.
- arguments – (Optional) Specifies a set of name/value pairs to be included as query arguments.
- extraURL – (Optional) Specifies an additional URL fragment to be included after the base URL and arguments.
Example
<Field>
<Display class='Link'>
<Property name='name' value='Request
Group Access'/>
<Property name='URL'
value='user/processLaunch.jsp?newView=true'>
<Property name='id' value='Group Request
Process'/>
</Display>
</Field>
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'
name='getOrganizationsDisplayNames'>
<ref>:display.session</ref>
<map>
<s>filterVirtual</s>
<o><Boolean>true</Boolean></o>
<s>current</s>
<list>
<ref>original.orgParentName</ref>
</list>
<s>excluded</s>
<list><ref>orgName</ref></list>
</map>
</invoke>
LinkForm
Renders a bulleted list of links, resembling a menu.
NameValueTable
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:
- flat list – The list is expected to contain name/value pairs such that element 0 is a name, element 1 is a value, element 2 is a name.
- map – The entries in the map are emitted in alphabetical order.
- GenericObject – The object is flattened to and emitted as a map.
Properties include _hideEmptyRows, which when set to true, hides rows for which no value exists.
MultiSelect
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:
- availableTitle – Specifies the title of the available box.
- selectedTitle – Specifies the title of the selected box.
- ordered – Defines whether selected items can be moved up or down within the list of items in the text box. A true value indicates that additional buttons will be rendered to permit selected items to be moved up or down.
- allowedValues – Specifies the values associated with the left side of the multiselection box. This value must be a list of strings. Note: The <Constraints> element can be used to populate this box, but its use is deprecated.
- sorted – Specifies that the values in both boxes will be sorted alphabetically.
- noApplet – Specifies whether the multiselect will be implemented with an applet or with a pair of standard HTML select boxes. The default is to use an applet, which is better able to handle long lists of values. See preceding note for information on using this option on systems running the Safari browser.
- typeSelectThreshold – (Available only when the noApplet property is set to true.) Controls whether a type-ahead select box appears under
the allowedValue list. When the number of entries in the left select
box reaches the threshold defined by this property, an additional text entry field appears under the select box. As you type characters into this text field, the select box will scroll to display the matching entry if one exists. For example, if you enter w, the select box scrolls to the first entry that begins with w.- width – Specifies the width of the selected box in pixels. The default value is 150.
- height – Specifies the width of the selected box in pixels. The default value is 400.
Example
<Field name='accounts[LDAP].LDAPDept' type='string'>
<Display class='MultiSelect' action='true'>
<Property name='title' value='LDAP Department'/>
</Display>
<Constraints>
<o>
<List>
<String>Sales</String>
<String>Marketing</String>
<String>International Sales</String>
</List>
</o>
</Constraints>
</Field>
Radio
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:
- title – Specifies the title for all radio buttons.
- labels – Specifies an alternate list of button labels. The labels list must be as long as the values in the allowedValues list. Alternate labels can be used in cases where the values are cryptic. For example, values can be letter codes such as H, M, and S, but you would use this property to identify button labels hours, minutes, and seconds.
- allowedValues – Specifies the value associated with each button. This value must be a list of strings.
- value – Specifies values for the buttons. This value accepts one string. If not set, then the values are the same as the labels.
Example
<Field name='attributes.accountLockExpiry.unit'>
<Display class='Radio'>
<Property name='noNewRow' value='true'/>
<Property name='labels'>
<List>
<String>UI_TASKS_XML_SCHED_MINUTES</String>
<String>UI_TASKS_XML_SCHED_HOURS</String>
<String>UI_TASKS_XML_SCHED_DAYS</String>
<String>UI_TASKS_XML_SCHED_WEEKS</String>
<String>UI_TASKS_XML_SCHED_MONTHS</String>
</List>
</Property>
<Property name='allowedValues'>
<List>
<String>minutes</String>
<String>hours</String>
<String>days</String>
<String>weeks</String>
<String>months</String>
</List>
</Property>
</Display>
</Field>
SectionHead
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.
Example
<Field>
<Display class='SectionHead'>
<Property name='text' value ='Calculated Fields'/>
</Display>
</Field>
Select
Displays a single-selection list box. Values for the list box must be supplied by the allowedValues property.
Properties for this display component are:
- allowedValues – Specifies the list of selectable values for display in the list box.
- allowedOthers – When set, specifies that initial values that were not on the allowedValues list should be tolerated and silently added to the list.
- autoSelect – When set to true, this property causes the first value in the allowedValues list to be automatically selected if the initial value for the field is null.
- multiple – When set to true, allows more than one value to be selected.
- nullLabel – Specifies the text that displays at the top of the list box when no value is selected.
- optionGroupMap – Allows the selector to render options in groups using the <optgroup> tag. Format the map such that the keys of the maps are the group labels, and the elements are lists of items to be selectable. (Values must be members of allowedValues in order to render.)
- size – (Optional) Specifies the maximum number of rows to display. If the number of rows exceeds this size, a scroll bar is added.
- sorted – When set to true, causes the values in the list to be sorted.
- valueMap – Maps raw values to displayed values.
The component supports the command and onChange properties.
Example
<Field name='city' type='string'>
<Display class='Select'>
<Property name='title' value='City'/>
<Property name='allowedValues'>
<List>
<String>Austin</String>
<String>Portland</String>
<String>New York</String>
</List>
</Property>
</Display>
</Field>
Text
Displays a regular text entry box.
Common properties for this display component are:
- size – Specifies the number of characters that are visible in the text entry box. The box size is recalculated depending upon the length of the text in the box.
- notrim – Specifies whether text posted from the HTML form is trimmed. Set to true to not trim white space. To preserve white space, set this option.
- maxLength – Specifies the maximum length of the string that can be edited in the text box.
- multiValued – Displays text boxes with Add and Remove buttons to add and remove values, when set to true.
- secret – Displays ***** (asterisks) in the place of entered text. This option is most often used in password fields.
- readOnly – Displays read-only text. This text cannot be edited by the user. You might use this property if, for example, you want to display resource attribute information that an administrator needs to view when creating or editing user accounts.
- submitOnEnter – When this property is set and the Text field has focus, then when the user presses the Enter key, the form is submitted using the command that is specified in the property value. In the following example, the form is submitted exactly as though the user has clicked Save.
Example
<Field name='variables.identityID'>
<Display class='Text'>
<Property name='required'>
<Boolean>true</Boolean>
</Property>
<Property name='title' value='Identity ID'/>
<Property name='size' value='32'/>
<Property name='maxLength' value='128'/>
<Property name='submitOnEnter' value='Save'/>
</Display>
</Field>
TextArea
Displays a multi-line text entry box.
Properties for this display component are:
- rows – Specifies the number of text area rows. (Integer)
- columns – Specifies the number of text area columns. (Integer)
- readOnly – Displays read-only text in the text entry box. When set to true, this component will not have a border. (Boolean)
- format – Set to control how setValue() behaves and determine the type of object returned by getPostData(). (String)
- sorted – Enables sorting of lines in the text area, when set to true. This feature is convenient when the area is used to display a list of selections, not free-form text. (Boolean)
- noTrim – Specifies whether text posted from the HTML form is trimmed. The default is to trim white space. To preserve white space, set this value to true.
Example
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'/>
</Display>
</Field>
If the user enters text beyond the defined visible rows, the text area displays a scroll bar.