Dynamically Show or Hide Attributes on a Screen - Identity Manager
search cancel

Dynamically Show or Hide Attributes on a Screen - Identity Manager

book

Article ID: 377934

calendar_today

Updated On:

Products

CA Identity Suite CA Identity Manager

Issue/Introduction

This article outlines the configuration steps to dynamically control the visibility of a screen attribute based on the value of another attribute within a read-only field context.

Environment

Identity Manager 14.5 & 15

Resolution

Objective You may need to hide or show an attribute dynamically based on the value selected or set in another attribute. The following example demonstrates how to hide the "String 000" field if the "Title" attribute is set to "Temp."

Configuration

  1. Navigate to the Admin Task where the attribute visibility needs to be controlled.
  2. Select Tabs > Profile and click the Browse button next to the Screen field, then select Edit.
  3. Locate and edit the attribute that triggers the change (e.g., "Title").


  4. In the Initialization JavaScript field, paste the following code:
function init(FieldContext) {   var title = FieldContext.getFieldValue("Title");
   if (title == "Temp") {      FieldContext.hideField("String 000");   } else {      FieldContext.showField("String 000");   }}
  1. Click OK, Select, OK, and Submit to save changes.

Note: Ensure the attribute names used in the JavaScript match the "Attribute Name" defined in the Identity Manager console, rather than the display name.

  

Additional Information

If the attribute you want to check is Read/Write, see the document How to Change Field Display Properties Dynamically - 14.5 or How to Change Field Display Properties Dynamically - v15

Note: The attribute will be shown/hidden after you type the value and change to another field.

To speak with a customer representative or a Support Engineer see Contact Support. Scroll to the bottom of the page and click on your respective region.