Fórum

about portletsession

wei tang, modificado 11 Anos atrás.

about portletsession

Junior Member Postagens: 36 Data de Entrada: 03/12/12 Postagens Recentes
Hello all, I use portletSession to save a hashmap, just like this:

<%
HashMap<Long,String> map = (HashMap<Long, String>)portletSession.getAttribute("selected.map");
System.out.println(map);//console print { } when i use search button
if(Validator.isNull(map))
{
map = new HashMap<Long,String>();
portletSession.setAttribute("selected.map",map);
}
......
%>
<aui:form action="<%=actionPath%>" method="post" >
<liferay-ui:search-toggle buttonLabel="search" displayTerms="<%=dt%>" id="toggle_id_formular_search">
......
<liferay-ui:search-container displayTerms="<%=dt%>" delta="<%=delta%>" emptyResultsMessage="no-materials-were-found">
......
</aui:form>

use jquery to active serveResource in FormularPortlet.java

FormularPorltet.java
...
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, PortletException
{
serveAddNo(resourceRequest, resourceResponse);
}
...

When i click next setp link or submit form to another page using submit button, portletSession work fine, but I click 'search button' , cann't found any key and value in hashmap, it's like be clear, why ?