Hello!
I need hide portlet dinamically in jetspeed 2.2.0, but no works to me. I follow the instructions, but, no works...
In my portlet, my doView method I'm informing 3 attributes:
public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException{
Fragment F = (Fragment)request.getAttribute("org.apache.jetspeed.Fragment");
request.setAttribute("js"+F.getId()+"HideDecorator", new Boolean(true));
request.setAttribute("HideDecorator", new Boolean(true));
request.setAttribute("Curro", "curro");
response.setContentType("text/html");
String jspName = getPortletConfig().getInitParameter("jspView");
PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(jspName);
rd.include(request,response);
}
in the decorator.vm I do:
#set($hidePortlet = $renderRequest.getAttribute("js_${jetspeed.CurrentFragment.Id}_HideDecorator"))
#set($Curro = $renderRequest.getAttribute("Curro"))
And I try to see his values in the screen for controlling if the attributes arrive:
Oculto? = ${hidePortlet}
Solo? = ${solo}
Curro? = ${Curro}
fragmento? = ${jetspeed.CurrentFragment.Id}
#if (!$solo && !$hidePortlet)
<div class="PTitle" >
<div class="PTitleContent">
...
And the result is
oculto? =${hidePortlet} Solo? = false Curro? = ${Curro} fragmento? =
dp-02-20.
And portlet is not hidden.
Following the instructions, I only have to do
request.setAttribute("js"+F.getId()+"HideDecorator", new Boolean(true));
but the attribute arrive empty to the decorator.vm. Debugging in eclipse, this attributes are created and informed, but they lost on the road...
mmm... I'm doing something wrong, but I don't know it... I tried it in my custom portal and a binary of jetspeed.
Do you know were is the problem?
Regards
I need hide portlet dinamically in jetspeed 2.2.0, but no works to me. I follow the instructions, but, no works...
In my portlet, my doView method I'm informing 3 attributes:
public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException{
Fragment F = (Fragment)request.getAttribute("org.apache.jetspeed.Fragment");
request.setAttribute("js"+F.getId()+"HideDecorator", new Boolean(true));
request.setAttribute("HideDecorator", new Boolean(true));
request.setAttribute("Curro", "curro");
response.setContentType("text/html");
String jspName = getPortletConfig().getInitParameter("jspView");
PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(jspName);
rd.include(request,response);
}
in the decorator.vm I do:
#set($hidePortlet = $renderRequest.getAttribute("js_${jetspeed.CurrentFragment.Id}_HideDecorator"))
#set($Curro = $renderRequest.getAttribute("Curro"))
And I try to see his values in the screen for controlling if the attributes arrive:
Oculto? = ${hidePortlet}
Solo? = ${solo}
Curro? = ${Curro}
fragmento? = ${jetspeed.CurrentFragment.Id}
#if (!$solo && !$hidePortlet)
<div class="PTitle" >
<div class="PTitleContent">
...
And the result is
oculto? =${hidePortlet} Solo? = false Curro? = ${Curro} fragmento? =
dp-02-20.
And portlet is not hidden.
Following the instructions, I only have to do
request.setAttribute("js"+F.getId()+"HideDecorator", new Boolean(true));
but the attribute arrive empty to the decorator.vm. Debugging in eclipse, this attributes are created and informed, but they lost on the road...
mmm... I'm doing something wrong, but I don't know it... I tried it in my custom portal and a binary of jetspeed.
Do you know were is the problem?
Regards