Forums de discussion
Maximize portlet in Edit mode
Adrien G, modifié il y a 13 années.
Maximize portlet in Edit mode
New Member Publications: 14 Date d'inscription: 15/10/10 Publications récentes
Hi all !
How to change the default URL of edit mode ? Because for my own portlet, the edit mode uses the "normal" window state instead of "maximized". (p_p_state=normal)
Thanks, bye ;)
How to change the default URL of edit mode ? Because for my own portlet, the edit mode uses the "normal" window state instead of "maximized". (p_p_state=normal)
Thanks, bye ;)
mohammed azam, modifié il y a 13 années.
RE: Maximize portlet in Edit mode
Regular Member Publications: 159 Date d'inscription: 06/11/09 Publications récentesAdrien G:
Hi all !
How to change the default URL of edit mode ? Because for my own portlet, the edit mode uses the "normal" window state instead of "maximized". (p_p_state=normal)
Thanks, bye ;)
Hi check this sample code... and implement it accordingly
PortletURL portletURL = renderResponse.createRenderURL();
portletURL.setWindowState(WindowState.MAXIMIZED);
Adrien G, modifié il y a 13 années.
RE: Maximize portlet in Edit mode
New Member Publications: 14 Date d'inscription: 15/10/10 Publications récentes
Thanks momo for your reply! ;)
I put this in my edit.jsp and I get "WindowState cannot be resolved"
Here is my code :
(I want to use JSF in the near future)
Thank you
I put this in my edit.jsp and I get "WindowState cannot be resolved"
Here is my code :
<%@ page contentType="text/html"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="core"%>
<%@ page import="javax.faces.context.FacesContext"%>
<portlet:defineobjects />
<%
PortletURL portletURL = renderResponse.createRenderURL();
portletURL.setWindowState(WindowState.MAXIMIZED);
%>
(I want to use JSF in the near future)
Thank you
Masroor Khan, modifié il y a 13 années.
RE: Maximize portlet in Edit mode
Regular Member Publications: 124 Date d'inscription: 09/09/08 Publications récentes
Hi,
you need to include init.jsp in you jsp page.
Regards,
Masroor
you need to include init.jsp in you jsp page.
Regards,
Masroor
mohammed azam, modifié il y a 13 années.
RE: Maximize portlet in Edit mode
Regular Member Publications: 159 Date d'inscription: 06/11/09 Publications récentes
include this jsp file
<%@ include file="/html/portlet/init.jsp" %>
else directly import the package
<%@ page import="javax.portlet.WindowState" %>
<%@ include file="/html/portlet/init.jsp" %>
else directly import the package
<%@ page import="javax.portlet.WindowState" %>
Adrien G, modifié il y a 13 années.
RE: Maximize portlet in Edit mode
New Member Publications: 14 Date d'inscription: 15/10/10 Publications récentes
Thanks guys for your advise,
<%@ page import="javax.portlet.WindowState" %> works, I don't have any errors but no changes !
Here is my code :
The portletURL is printed, and this is the good one. So the page should be reload with this url.
Any ideas ? Thanks
<%@ page import="javax.portlet.WindowState" %> works, I don't have any errors but no changes !
Here is my code :
<%@ page contentType="text/html"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="core"%>
<%@ page import="javax.faces.context.FacesContext"%>
<%@ page import="javax.portlet.WindowState" %>
<%@page import="javax.portlet.PortletURL"%>
<%@page import="javax.portlet.RenderResponse"%>
<portlet:defineobjects />
<%
PortletURL portletURL = renderResponse.createRenderURL();
portletURL.setWindowState(WindowState.MAXIMIZED);
out.print(portletURL.toString());
%>
<p>Edit mode</p>
The portletURL is printed, and this is the good one. So the page should be reload with this url.
Any ideas ? Thanks
Adrien G, modifié il y a 13 années.
RE: Maximize portlet in Edit mode
New Member Publications: 14 Date d'inscription: 15/10/10 Publications récentes
Ok I just add this to liferay-portlet.xml, and that's enough
Thanks ;)
<liferay-portlet-app>
<portlet>
<portlet-name>menu-portlet</portlet-name>
<icon>/icon.png</icon>
[color=#F01818][size=7][b]<maximize-edit>true</maximize-edit>[/b][/size][/color]
<instanceable>true</instanceable>
<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
</portlet>
...
</liferay-portlet-app>
Thanks ;)