+

Search Tips   |   Advanced Search


Close the task page

The Task Processing portlet retrieves the TaskUIManager portlet service to close the task page and return the user to the task list page. Refer to the code samples for developing a standard portlet. You should have experience developing portlets, including cooperative portlets, using either the standard portlet API, the Task UI Manager API, the Property Broker API, and the Task API.

To add code for the Task Processing portlet to close the task page and open a new task page, use these code samples:

  1. Obtain an instance of the TaskUIManager portlet service.

       public void init(PortletConfig portletConfig) 
                   throws PortletException, UnavailableException
       {
          super.init(portletConfig);
    
          ...
    
          Context ctx = new InitialContext();
    
          PortletServiceHome serviceHome = (PortletServiceHome)
          ctx.lookup("portletservice/com.ibm.portal.portlet.service.taskui.TaskUIManager"); 
     
          taskUIManager = (TaskUIManager)
          serviceHome.getPortletService(TaskUIManager.class);
    
          ...
    
       }      
    

  2. Use the following methods to close the page and set the new page:

    1. The closeTaskUI() method closes the task page specified by the TaskUIHandle.

    2. The setPage() method indicates the new page (ReturnPageID) that will be opened.

    3. For the standard portlet API, both methods accept either the ActionRequest and ActionResponse arguments.

    public void processAction (ActionRequest request, ActionResponse response) 
           throws PortletException, java.io.IOException{
       ...
    
    
    

    TaskUIHandle taskUIHandle = (TaskUIHandle) portletSession.getAttribute("TaskUIHandle");

    ObjectID returnPageID = (ObjectID) portletSession.getAttribute("ReturnPageID"); taskUIManager.closeDynamicUI(request, response, taskUIHandle); taskUIManager.setPage(request, response , returnPageID); ...}


Parent topic:

Creating Task Processing portlets


Previous topic:

Process the input and output messages of the task


Next topic:

Import required class libraries


Related concepts


Portlet services