Forums Register Login

Hide Portlet int jetspeed

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
excuseme, I said that the attribute arrives empty to the decorator.vm and it is incorrect. The attribute not arrives. I do in decorator.vm:

#foreach($Q in $renderRequest.getAttributeNames())
atributo? = ${Q} - valor = ${renderRequest.getAttribute($Q)}
<br>
#end

ant the attribute not appears...

Thanks
Francisco
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1142 times.
Similar Threads
Solo state in Portal server
show/hide portlets in portal
Problem with a portlet
Checkbox Isuue
how to call Jsp in servlet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:22:25.