Article

wschreiber's picture
article
Reads:

4847

Score:
2
2
1
 
Comments:

0

Generate Full Name in Custom iManager Pages

(View Disclaimer)

The default iManager pages to create new users will auto-generate a full name for the user.

However, when creating custom pages in iManager using PluginStudio to edit or create users, the "Fullname" field won't get updated automatically.

With a little JavaScript/HTML knowledge this can be done quite easily. Here's how to proceed:

  • Locate the JSP that represents your "create user" page. If you created it with PluginStudio, it will be located in

    [..]\tomcat\webapps\nps\portal\modules\custom\skins\default\devices\default\

    The file name consists of the name you chose for the task and a time stamp. Something like "create_user_20081205_204600.jsp"

    - if you have used PluginStudio to edit your task, there may be multiple copies with different time stamps.

    Select the most recent one and create a backup copy.

  • Add a JavaScript function that generates the Fullname and put it into the existing <SCRIPT> .. </SCRIPT> section of your JSP.

    The function could look like this

        function generateFullname()
        {
            var form=document.forms[0];
            var result = '';
            if ( form._Given_Name != null ) {
                if ( form._Given_Name.value != '' ) 
                result = form._Given_Name.value + ' ';
            }
            if ( form._Surname != null ) result += form._Surname.value;
            if ( form._Full_Name != null ) form._Full_Name.value = result; 
        }
    	
    
  • Now you need to add calls to this function that get executed when the Given Name or Surname change.

    Locate the HTML line that represents the Surname input field. Look for something like

    <INPUT type='text' name="_Surname"  ... >

    and insert the function call, so that it looks like

    <INPUT type='text' onkeyup='generateFullName();' name="_Surname"  ... >

    Locate the HTML line that represents the Given Name input field. Look for something like

    <INPUT type='text' name="_Given_Name"  ... >

    and insert the function call, so that it looks like

    <INPUT type='text' onkeyup='generateFullName();' name="_Given_Name" ... >
  • Save the file and you're done. The effects should should show immediately.

Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

© 2013 Novell