Forums de discussion

Liferay Pop Up in custom JSP Hook

joel stenberg, modifié il y a 10 années.

Liferay Pop Up in custom JSP Hook

New Member Publications: 3 Date d'inscription: 20/02/13 Publications récentes
Hi,

Im using liferay 6.0.6 and im trying to open up a Pop Up from custom JSP Hook.
The page which im trying to add pop up link to is edit_pages_public_and_private.jspf and export_pages.jsp, both which are located under /html/portlet/communities/

I have added a test.jsp in the custom JSP hook under the same structure tree as edit_pages_public_and_private.jspf and export_pages.jsp. This is the JSP page which i want to open up in a Pop Up, but when i try to open it in a Pop Up, the same window opens up, always.
Is it even possible to open up a new JSP in custom JSP hook, using Pop Up?

Code and Image below:



In both edit_pages_public_and_private.jspf and export_pages.jsp the Pop Up code looks like this.

<a href="javascript:showPopup()">Test1</a>
<a href="javascript:showPopup2()">Test2</a>
<a href="javascript:showPopup3()">Test3!</a>

<portlet:renderurl var="testURL" windowstate="<%= LiferayWindowState.POP_UP.toString() %>">
	<portlet:param name="jspPage" value="test.jsp" />
	<portlet:param name="redirect" value="<%= currentURL %>" />
</portlet:renderurl>

<portlet:renderurl var="test2URL" windowstate="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
  <portlet:param name="jspPage" value="/test.jsp" />
  <portlet:param name="redirect" value="<%= currentURL %>" />
</portlet:renderurl> 

<liferay-portlet:renderurl var="test3URL" windowstate="<%= LiferayWindowState.EXCLUSIVE.toString()  %>">
<portlet:param name="jspPage" value="/communities/test.jsp" />
<portlet:param name="redirect" value="<%= currentURL %>" />
</liferay-portlet:renderurl>

<aui:script>

function showPopup() {
  AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
    var dialog = new A.Dialog({
            title: 'Popup Title',
            centered: true,
            draggable: true,

        }).plug(A.Plugin.IO, {uri: '&lt;%= testURL %&gt;'}).render();
        dialog.show();
  });
}

function showPopup2() {
	  AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
	    var dialog = new A.Dialog({
	            title: 'Popup Title',
	            centered: true,
	            draggable: true,
	            modal: true
	        }).plug(A.Plugin.IO, {uri: '&lt;%= test2URL %&gt;'}).render();
	        dialog.show();
	  });
	} 

function showPopup3() {
	  AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
	    var dialog = new A.Dialog({
	            title: 'Popup Title',
	            centered: true,
	            draggable: true,
	            modal: true
	        }).plug(A.Plugin.IO, {uri: '&lt;%=test3URL  %&gt;'}).render();
	        dialog.show();
	  });
	} 
</aui:script>