Directly Closing the Modal on Script Completion

To close a modal dialog directly upon completion of; or exit (Exit, Save & Exit actions) from an IEG script execution, the script developer must specify a resolve UIM as the finish-page and/or quit-page. That resolve UIM must in turn invoke a custom JSP that calls the appropriate JavaScript function to close the dialog.

For example, to redirect to the IEG2_listAllIEG2Scripts administration screen, include the following JSP scriptlet in your UIM file:

<PAGE
   PAGE_ID="IEG2_resolveFinishScript"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="file://Curam/UIMSchema.xsd"
 >
 <JSP_SCRIPTLET>
   <![CDATA[
  
     curam.omega3.request.RequestHandler 
       rh = curam.omega3.request.RequestHandlerFactory
           .getRequestHandler(request);
              
     String context = request.getContextPath() + "/";
     context += curam.omega3.user.UserPreferencesFactory
         .getUserPreferences(
           pageContext.getSession()).getLocale() + "/"; 
                  
     String url = "";
     url = context + "IEG2_listAllIEG2ScriptsPage.do";
            
     String forwardParams = 
         request.getParameter("forwardParams");
      
     if (screenContext != null && screenContext
         .hasContextBits(
         curam.omega3.taglib.ScreenContext.MODAL)) {
       url += "?" +  rh.getSystemParameters();
       String encodeRedirectURL = response.encodeURL(url);
       response.sendRedirect(response.encodeRedirectURL(
           request.getContextPath() +
               "/ieg/CloseAndRedirect.jspx?redirect=" 
               + encodeRedirectURL));
     } else {
       url += "?" +  rh.getSystemParameters();
       response.sendRedirect(
           response.encodeRedirectURL(url));
     }
            
     ]]>
 </JSP_SCRIPTLET>
</PAGE>

CloseAndRedirect.jspx is provided out-of-the-box for closing the modal dialog and redirecting to a specified UIM (if provided) in the parent.