Dynamically Hiding Task Tabs Using JavaScript - Identity Manager
search cancel

Dynamically Hiding Task Tabs Using JavaScript - Identity Manager

book

Article ID: 257598

calendar_today

Updated On:

Products

CA Identity Manager CA Identity Suite

Issue/Introduction

This article explains how to conditionally hide tabs within an Identity Manager task using custom JavaScript. This functionality is implemented via the "Tab Display JavaScript" property in the Tab Controller configuration.

Environment

Identity Manager 14.5 & 15

Cause

Dynamic tab visibility is managed by the TabControllerContext and its associated JavaScript methods. Administrators can programmatically control tab rendering based on user attributes or task states by implementing the displayTab function.

Resolution

Implementation Requirements

  1. Function Signature: The JavaScript must include the function function displayTab(TabControllerContext, tabIndex).
  2. Return Values:
    • true: Displays the tab at the specified index.
    • false: Hides the tab at the specified index.

Configuration Procedure

  1. Access Task Configuration: Navigate to the Task Controller configuration in the Identity Manager Console.
  2. Implement Display Logic: Apply the following sample code to the "Tab Display JavaScript" field. This example checks for a specific user attribute value before hiding the second tab (index 1).
    function displayTab(ctx, tab) {    // Retrieve attribute value from the current user context    var userAttr = ctx.getUser().getAttribute("imAttributeFoo");
        // Conditional logic to hide the second tab (index 1)    if (userAttr == "my_value") {        if (tab == 1) {            return false;        }    }    return true;}
  3. Review API Methods: The TabControllerContext (ctx) object inherits methods from BLTHContext. For a full list of accessible methods, refer to the Identity Manager Programming Reference and download the im_javadoc.zip.

Additional Information

For comprehensive details on task navigation and sequencing, consult the Configure a Tab Sequence - 14.5 and Identity Manager Programming Reference - 14.5

For Identity Manager v15, see Configure a Tab Sequence - v15 and Identity Manager Programming Reference - v15

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.