It is often desirable to use popup windows to implement application functionality. These can be problematic in a portal environment. To successfully implement popup windows in a portal environment, care must be taken to understand the context in which the window is executing. Normally, a portlet is invoked by the portlet container. When implementing popup windows the portlet is actually called directly through the servlet container. (This is very similar to how Portlet Factory models are called in test or standalone mode.)
Attached is a sample model demonstrating how to create a popup window from a portlet. The main technique used here is the use of the getBackchannelActionURL method of the WebAppAccess object. This method generates a URL that accesses an action in the model via the application's servlet context. It is important to note that any actions called in the model through this means will not have access to all of the portal context that is usually present in a portlet application.
Here is a screenshot of the attached sample model:
Notes on running the sample and prerequisites
Import the attached zip file into your project using the Import WebSphere Portlet Factory Archive command.
This sample should run in both a standalone context as well as in a portlet context.
The sample model can be downloaded here: PopupSample.zip