Thanks David,

In my portlet, my doView method is:

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 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.

mmm... I'm doing something wrong, but I don't know... I tried it in my
custom portal and a binary of jetspeed. :(

Regards


-----Original Message-----
From: David Sean Taylor [mailto:[email protected]] 
Sent: miércoles, 24 de febrero de 2010 23:37
To: Jetspeed Developers List
Subject: Re: Hide portlet

On Wed, Feb 24, 2010 at 5:02 AM, curro
<[email protected]>wrote:

> Hello
>
> I understand RenderRequest is a subinterface of PortletRequest. Then, I
> thought that doing in the doView method of my Portlet
> RenderRequest.setAttribute("HideDecorator", new Boolean(true)), works.
>
> But the attribute not comes to decorator.vm. I make
> RenderRequest.setAttribute("Qro", "qro") and not comes to decorator.vm.
>
> Look at the velocity code in the decorator:

   #set($hidePortlet = $renderRequest.getAttribute("js_${
jetspeed.CurrentFragment.Id}_HideDecorator"))

The attribute name is specific to the current fragment window id


>
> Please, What am I doing wrong? The issue JS2-710 is not clear for me. The
> method getPortletRequest() confused me.
>
>
ignore the getPortletRequest(), that is confusing, its just a plain old
renderRequest

Se certificó que el correo entrante no contiene virus.
Comprobada por AVG - www.avg.es 
Versión: 9.0.733 / Base de datos de virus: 271.1.1/2707 - Fecha de la
versión: 02/24/10 08:34:00


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to