Hi Ryan,
Thanks for the info.
What we are trying to achieve is the following:
For senior users we would like their homepage interface to be really simple by presenting a number of big buttons for basic functions like calendar, directory etc. These buttons would be small portlets that each show a 121x121 px clickable image. If you click the image the actual portlet (like calendar) will show in a popup(window). when you close the popup, your focus is back on the page with the big buttons.
I found code fragments in the forums and wiki to accomplish this, like:
http://www.liferay.com/community/forums/-/message_boards/message/6206616
http://www.liferay.com/community/forums/-/message_boards/message/7074351#_19_message_6249929
and
http://www.emforge.net/web/akakunin/blogs/-/blogs/display-portlet-in-ajax-popup:-liferay-5-&-6-versions
I used a sample JSP portlet and the third link above from the community and put the code, taglibs etc. in the view.jsp as a test. It deploys but when run Liferay complains about missing entities. This is my test view.jsp:
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
<%@ taglib uri="http://liferay.com/tld/security" prefix="liferay-security" %>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util" %>
<%@ page import="javax.portlet.MimeResponse" %>
<%@ page import="javax.portlet.PortletConfig" %>
<%@ page import="javax.portlet.PortletContext" %>
<%@ page import="javax.portlet.PortletException" %>
<%@ page import="javax.portlet.PortletMode" %>
<%@ page import="javax.portlet.PortletPreferences" %>
<%@ page import="javax.portlet.PortletRequest" %>
<%@ page import="javax.portlet.PortletResponse" %>
<%@ page import="javax.portlet.PortletSession" %>
<%@ page import="javax.portlet.PortletURL" %>
<%@ page import="javax.portlet.RenderRequest" %>
<%@ page import="javax.portlet.RenderResponse" %>
<%@ page import="javax.portlet.ResourceURL" %>
<%@ page import="javax.portlet.UnavailableException" %>
<%@ page import="javax.portlet.ValidatorException" %>
<%@ page import="javax.portlet.WindowState" %>
<portlet:defineObjects />
<liferay-theme:defineObjects />
<%
WindowState windowState = null;
PortletMode portletMode = null;
PortletURL currentURLObj = null;
if (renderRequest != null) {
windowState = renderRequest.getWindowState();
portletMode = renderRequest.getPortletMode();
currentURLObj = PortletURLUtil.getCurrent(renderRequest, renderResponse);
}
else if (resourceRequest != null) {
windowState = resourceRequest.getWindowState();
portletMode = resourceRequest.getPortletMode();
currentURLObj = PortletURLUtil.getCurrent(resourceRequest, resourceResponse);
}
String currentURL = currentURLObj.toString();
//String currentURL = PortalUtil.getCurrentURL(request);
%>
<portlet:renderURL var="somePageURL" windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
<portlet:param name="jspPage" value="/popup.jsp"/>
<portlet:param name="redirect" value="<%= currentURL %>"/>
</portlet:renderURL>
<script type="text/javascript">
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,
modal: true
}).plug(A.Plugin.IO, {uri: '<%= somePageURL %>'}).render();
dialog.show();
});
}
<a href="javascript: showPopup(); ">Click here to show popup </a>
In other words: I have proper popup code linking to another jsp but the rest of my view.jsp is sub par ;-). So what would be the correct JSP for this with the right taglibs etc.?
After this first test I wanted to proceed with the code in the first two links that would actually open a portlet (like Calendar) in exclusive mode in a popup, which is my actual goal.
If you could point out why the jsp is not working or even supply me with a basic working example of a portlet/view.jsp that opens another portlet in a popup window, I would be very grateful.
I hope you can put me in the right direction.
Regards,
Arne.
Firmi prego dentro per inbandierare questo come inadeguato.