Sun Identity Manager Deployment Reference

Other Form-Related Tasks

Miscellaneous form-related tasks include:

Invoking the FormUtil Methods

The FormUtil class is a collection of utility methods that you can call from XPRESS expressions with form objects. They can be used to populate lists of allowed values and validate input. The FormUtil methods are typically called to assist the definition of the allowed values in a list or field.

<invoke class = ’com.waveset.ui.FormUtil’
   name = ’listResourceObjects’>

where the name field identifies the name of the method.

For examples on using these methods within forms, see the section titled Using Hidden Components.

Inserting JavaScript into a Form

To insert pre-formatted Javascript into a form, use the <script> component as follows:


Testing if an Object or User Exists

You might want to check whether an object exists before performing an action. For example, you could look to see if a user name exists in Identity Manager before creating a new user, or validate whether a manager name entered in a field is valid.

To test if an object exists, use the testObject method. To specify an object type when using this method, use the object types listed in the section titled Retrieving a List of Accessible Object Types. In the following example, the user type is identified as <s>User</s>. The second string gives the value of the object type (in this example, jdoe).


<invoke name=’testObject’ class=’com.waveset.ui.FormUtil’>

The testObject method returns true on successful find of an object. Otherwise, this method returns null.

To test if a user exists, use the testUser method. The <s> element identifies the name of the user object to find. Example:

<invoke name=’testUser’ class=’com.waveset.ui.FormUtil’>

This method returns true on successful find. Otherwise, this method returns null.

Inserting Alert Messages into XPRESS Forms

You can insert WARNING), error (ERROR), or informational (OK) alert messages into an XPRESS form.

Note –

Although this example illustrates how to insert a Warning ErrorMessage object into a form, you can assign a different severity level.

ProcedureTo Insert an Alert Message

  1. Use the Identity Manager IDE to open the form to which you want to add the warning.

  2. Add the <Property name=’messages’> to the main EditForm or HtmlPage display class.

  3. Add the <defvar name=’msgList’> code block from the following sample code.

  4. Substitute the message key that identifies the message text to be displayed in the Alert box in the code sample string:


  5. Save and close the file.

    <Display class=’EditForm’>
       <Property name=’componentTableWidth’ value=’100%’/>
       <Property name=’rowPolarity’ value=’false’/>
       <Property name=’requiredMarkerLocation’ value=’left’/>
       <Property name=’messages’>
    <defvar name=’msgList’>
          <new class=’com.waveset.msgcat.ErrorMessage’>
            <invoke class=’com.waveset.msgcat.Severity’ name=’fromString’>

    To display a severity level other than warning, replace the <s>warning</s> in the preceding example with either of the these two values:

    • error -- Causes Identity Manager to render an InlineAlert with a red “error” icon.

    • ok -- Results in an InlineAlert with a blue informational icon for messages that can indicate either success or another non-critical message.

    Identity Manager renders this as an InlineAlert with a warning icon

    <invoke class=’com.waveset.msgcat.Severity’ name=’fromString’>

    where warning can also be error or ok.

Wizard and Tabbed Forms

Both wizard and tabbed forms are mechanisms for structuring unwieldy, single-page forms into more easily managed, multiple-paned forms. Both contain separators between logical sections, or pages. These page separators can be tabs located at the top of the form -- like the tabbed user form -- or a wizard form, which guide the user through the pages using the next/back navigation buttons.

See Tabbed User Form in this chapter for the XML version of the default Tabbed User Form.

What Is a Wizard Form?

Wizard forms can be a convenient alternative to launching multiple forms from a task when:

Wizard forms contain the two rows of buttons described below.

Table 2–18 First Row of Buttons

Row of buttons  


top row 

Next and Back buttons to traverse through the form panes 

second row 

Contains the standard user form buttons listed in the following table. You can control the second row by setting noDefaultButtons option to true and implementing your own buttons.

This second row of button can vary as follows:

Table 2–19 Second Row of Buttons

Wizard page  

Default buttons  

first page 

Next, Cancel 

intermediate pages 

Prev, Next, Cancel 

last page 

Prev, Ok, Cancel 

Implementing a Wizard Form

Wizard form syntax closely resembles tabbed user form structure. ,

ProcedureTo Create a Wizard Form

  1. Assign the WizardPanel display class to the top-level container (rather than TabbedPanel).

  2. Set the noCancel property to true.

  3. Define one or more EditForm fields that contain the pages of the wizard.

    The following example provides comments for guidance purposes:

       <Display class="HtmlPage"/> ----- If not set, causes indentation and color problems
       <Field name=’MainTabs’> -- Name of the top container that wraps the tab pages
          <Display class=’TabPanel’/> -- Display class for the top container: 
                                         either TabPanel or WizardPanel
       <Field name=’Identity’> -- Label of the Tab
          <Display class=’EditForm’> -- Each “page” must be an Edit Form
             <Property name=’helpKey’ value=’Identity and Password Fields’/>
       <Field name=’waveset.accountId’>
          <Display class=’Text’>
             <Property name=’title’ value=’_FM_ACCOUNT_ID’/>
    <Disable> <ref></ref> </Disable>

Tips and Workarounds