Portal, V6.1
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:
- 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); ... }- Use the following methods to close the page and set the new page:
- The closeTaskUI() method closes the task page specified by the TaskUIHandle.
- The setPage() method indicates the new page (ReturnPageID) that will be opened.
- If you are using 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 taskNext topic:
Import required class libraries
Related concepts
Portlet services