留言板
[Solved] Search-container shows blank page on Next
Clément Derodit,修改在12 年前。
[Solved] Search-container shows blank page on Next
New Member 帖子: 2 加入日期: 11-9-30 最近的帖子
Hi everyone,
For my project, I have to display a list of users. This list has two columns, one for the user's name and one for his id number.
This list can be very long so I need to paginate it.
I'm using a <liferay-ui:search-container> to achieve that. I display my portlet in a pop-up window.
After loading, I can see the created table with my data. But everytime I click on next or select a page number directly, the page goes blank and no error message is displayed.
Here is the code of my jsp :
In my view.jsp, I call my jsp with this code :
It seems the problem resides in the windowState of my jsp after clicking on next (it sould be LiferayWindowState.NORMAL but change into LiferayWindowState.EXCLUSIVE everytime ) When I change it to NORMAL in the url, it works (but it seems the paging doesn't work either )
I'm using Liferay 6.0.6 CE with an Apache Tomcat Server 6.0.29
Thanks for your help.
Solution : (add this in the jsp)
<%@page import="javax.portlet.PortletURL"%>
<%
PortletURL lPortletURL = renderResponse.createRenderURL();
lPortletURL.setWindowState(LiferayWindowState.NORMAL);
%>
<liferay-ui:search-container delta="10" emptyResultsMessage="No Results Were found" iteratorURL="<%= lPortletURL %>">
For my project, I have to display a list of users. This list has two columns, one for the user's name and one for his id number.
This list can be very long so I need to paginate it.
I'm using a <liferay-ui:search-container> to achieve that. I display my portlet in a pop-up window.
After loading, I can see the created table with my data. But everytime I click on next or select a page number directly, the page goes blank and no error message is displayed.
Here is the code of my 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/ui" prefix="liferay-ui" %>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="javax.portlet.RenderResponse"%>
<%@page import="javax.portlet.PortletURL"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="com.liferay.portal.kernel.util.ListUtil" %>
<%@page import="fr.msa.agora.z80tech.beans.RessourceDossierBean"%>
<portlet:defineobjects />
<portlet:actionurl var="ressource" windowstate="<%= LiferayWindowState.NORMAL.toString() %>"></portlet:actionurl>
<%
List<ressourcedossierbean> lListeRessources = (ArrayList<ressourcedossierbean>) portletSession.getAttribute("listeRessources");
%>
<liferay-ui:search-container delta="10" emptyresultsmessage="No Results Were found for the Selected Criteria">
<liferay-ui:search-container-results total="<%= lListeRessources.size() %>" results="<%= ListUtil.subList(lListeRessources,searchContainer.getStart(),searchContainer.getEnd()) %>" />
<liferay-ui:search-container-row modelvar="ressourceDossierBean" classname="fr.msa.agora.z80tech.beans.RessourceDossierBean">
<liferay-ui:search-container-column-text name="Dossier" property="idRessource" orderable="<%=true%>" orderableProperty="idRessource" />
<liferay-ui:search-container-column-text name="Raison Sociale" property="raisonSociale" orderable="<%=true%>" orderableProperty="raisonSociale" />
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="true" />
</liferay-ui:search-container>
</ressourcedossierbean></ressourcedossierbean>
In my view.jsp, I call my jsp with this code :
<% final String lCible = (String)renderRequest.getAttribute("z80portlet_page"); %> <portlet:renderurl var="pageCourante" windowstate="<%= LiferayWindowState.EXCLUSIVE.toString() %>"> <portlet:param name="jspPage" value="<%=lCible%>" /> </portlet:renderurl>
<aui:script> function showPopup() { AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) { var dialog = new A.Dialog({ title: '<%=lTitle %>', height: 480, width: 640, centered: true, draggable: false, resizable: false, close: false, modal: true }).plug(A.Plugin.IO, {uri: '<%=pageCourante%>'}).render(); dialog.show(); }); } showPopup(); </aui:script>
It seems the problem resides in the windowState of my jsp after clicking on next (it sould be LiferayWindowState.NORMAL but change into LiferayWindowState.EXCLUSIVE everytime ) When I change it to NORMAL in the url, it works (but it seems the paging doesn't work either )
I'm using Liferay 6.0.6 CE with an Apache Tomcat Server 6.0.29
Solution : (add this in the jsp)
<%@page import="javax.portlet.PortletURL"%>
<%
PortletURL lPortletURL = renderResponse.createRenderURL();
lPortletURL.setWindowState(LiferayWindowState.NORMAL);
%>
<liferay-ui:search-container delta="10" emptyResultsMessage="No Results Were found" iteratorURL="<%= lPortletURL %>">