How to open a portal page in dialog box

In the Opening a popup inside portlet, i built a sample portlet that will open in a popup dialog box, but most probably you will want to open another portal page in dialog box.

You can do that by creating a URL mapping to the portal page that you want to open in popup dialog box. In my local environment i have a portal page at /wpcert/mydemo/jmeter1 URL, that i wanted to open in popup dialog box, so i changed my JSP like this

<%@page language="java" contentType="text/html; %>
<%@taglib uri="" prefix="portlet"%>
<%@ taglib uri="" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/portal.tld" prefix="portal" %>

<portlet:defineObjects />
<h3>Popup portlet</h3>

<script type="text/javascript">
function openPopup(popupUrl){
if (window.showModalDialog) {
} else {,'name',
scrollbars=no,resizable=no ,modal=yes');

<input type="button" onclick="openPopup('/wpcert/mydemo/jmeter1')"
label="Open popup" value="Open Popup" />

And now this is how my portal page popup dialog box looks like

If you dont want to create all the URL mappings upfront then you can also use Portal URL generation service for creating URL to the portal page, i might blog about sample portlet :)

1 comment:

Ramesh K said...

Thanks for sharing this informative information..
For Storm components all over information you may also refer....