Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hide Portlet int jetspeed

 
Francisco Rosado
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Francisco Rosado
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic