NSD1162 How to design an Identity Manager form with two or more connected Combobox'es

Fact

Nordic Edge Identity Manger 4

Situation

The scenario is that we design an IM form with two or more Combobox'es to select some data from. A common requirement is that when this selection is done in one list (the source) that will affect the contents of another Combobox (the target). One typical use case is that the source dropdown list is prepopulated with the continents of the world and when one continent is selected the target dropdown list is populated with the countries of that continent.

Solution

This mechanism is realised as IM filters, an Init Tab filter that populates the dropdown lists at startup and a Key filter that will monitor the source dropdown list and handle the changes when the user makes a selection. The values that are used to populate a Combobox are stored in a multivalue textattribute on an object in the LDAP catalog that is associated with the Tab form. The object distinguished name (dn) and the attribute name is configured as a parameter to the source dropdown list. 

More than two Combobox'es can be chained using this mechanism. 


Configuration

The mechanism is included in NordicEdge Identity Manager (version 4 and later) and the inclusion is configured as IM filters. The source Combobox where the user selects a value is configured to populate the target Combobox. This is achieved by adding a specific filter as a Key filter to the Combobox. The filter JavaScript is js/linkDd2Dd.js and the Function is populate and the function is configured to receive two paramters. The first is the Variable of the target Combobox.

The second is the ou where the population data is found.

Now when the user selects a value in the Combobox, this value is added as cn to the ou that has been configured. E g if the source 
Key filter populate Function is configured with the second parameter = "ou=Data,o=NEIM,l=Stockholm,c=SE" and the selected value is
"Europe" then the catalogue object that is used to populate the target Combobox is found using "cn=Europe,ou=Data,o=NEIM,l=Stockholm,c=SE". 
The default multivalue attribute is "description" but any multivalue String attribute will do and is configured by adding the
attribute name to the ou of the configuration separated by a colon. E g by using "cn=Europe,ou=Data,o=NEIM,l=Stockholm,c=SE:countries" 
the values will be fetched from the attribute named "countries" in the object with dn= "cn=Europe,ou=Data,o=NEIM,l=Stockholm,c=SE"

In the Key filter the following Java class and method need to be configured as well;  
Java class: se.nordicedge.servlets.actions.impl.PopulateDropdown, method: execute.

The first Combobox in the chain of lists is populated as a normal Combobox in an Identity Manager Tab by either setting static values in the 
configuration or fetching the values from a LDAP or SQL (JDBC) data source.

The last Combobox in the chain of lists is configured with a key filter stating ONLY the the following Java class and method;  
Java class: se.nordicedge.servlets.actions.impl.PopulateDropdown, method: execute.

The initial load of the Tab will have to initialise any Combobox'es that have values. This is done by simply adding a Tab init filter, 
filter.DDLinkFilter, to the Tab.

To connect one dropdown (source) to populate another(target) follow these steps
1. Download DdLink.zip from link at the bottom of this document

2. Install components to standalone IM according to the installation manual

3. Install components to web IM according to the installation manual

4. Set Tab External Filter to filter/DDLinkFilter for the IM TAB that the dropdowns are created. 
5. Set Key filter for the source dropdown to 

    Java Class:      se.nordicedge.servlet.action.impl.PopulateDropdown
    Method:        execute
    JavaScript:     js/linkDd2Dd.js 
    Function:     populate

    Parameter value 1: targetAttribute (click Variable button and select target dropdown)
    Parameter value 2: ou (Click String button and type the complete ou string). Add a colon and name of multivalue LDAP attribute if not
                description. 

6. Set Key filter for target dropdown
    Java Class:      se.nordicedge.servlet.action.impl.PopulateDropdown
    Method:        execute


Attachement


Disclaimer

The origin of this information may be internal or external to Nordic Edge™. Nordic Edge™ makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Nordic Edge™ makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.

Nordic Edge Support – www.nordicedge.se

Comments are closed.