Forums

Home » Liferay Portal » English » Liferay Legacy

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Dave Finch
problem with popup
September 5, 2005 1:36 AM
Answer

Dave Finch

Rank: Junior Member

Posts: 40

Join Date: February 2, 2005

Recent Posts

Hi,<br /><br />Does anyone know how to use popups on a portlet?<br />I have a popup which is opened using javascript window.open()<br />The url is an actionURL using the portlet taglib and I am setting the windowstate to LiferayWindowState.POP_UP.toString()<br />The popup works fine but the problem I am having is that after opening the popup, if I click on tab to reload the layout, all the portlets on the page are replaced with the page from my popup.<br /><br />Am I doing something wrong?<br />Is it something to do the struts URL being related to the portlet?<br /><br /><br />Thanks,<br /><br />Dave<br />
Kanakaraj Cheram
Popup in Liferay using jsp
May 26, 2008 12:26 AM
Answer

Kanakaraj Cheram

Rank: New Member

Posts: 20

Join Date: April 8, 2008

Recent Posts

Hi,
Popups can be creted in liferay..follow these ...

in your jsp... // create link to call the popup action link
"
<a onclick="var popup = window.open('<portlet:actionURL windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="struts_action" value="actionname" /><portlet:param name="urname" value="urvalue" />
</portlet:actionURL>', 'template', 'directories=no,height=640,location=no,menubar=no,resizable=yes,scrollbars=yes,width=650,height=750');void('');
popup.focus();">popup</a>
"


in action..... //check the action link
String cmd=ParamUtil.getString(req, "popup");
if (cmd.equalsIgnoreCase("popup")) {
popup(req);
}
// response page setfoward
protected void popup(ActionRequest req) throws Exception {
setForward(req, "portlet.ext.test.popup"); // render page struts setForward() ..
}

//jsp page response
struts config file...
<forward name="portlet.ext.test.popup" path="portlet.ext.test.popup"/>


tile def...

<definition extends="portlet" name="portlet.ext.test.popup">
<put name="portlet_content" value="/portlet/ext/test/popup.jsp"/>
</definition>
//pop.jsp
<html>
<body>

<h1> sample popup in liferay

</body>

</html>

have a fun
ankit yakkundi
RE: Popup in Liferay using jsp
August 27, 2010 11:07 AM
Answer

ankit yakkundi

Rank: Regular Member

Posts: 221

Join Date: March 4, 2010

Recent Posts

hi..
can you please help me with pop ups.
can you give me the code to create pop ups for simple jsp portlet or can you share view.jsp page.

or can you transform the above code for jsp portlet???

thanks in advance..