0 Replies Latest reply on May 3, 2010 5:36 PM by Mauro Lopez

    Public render parameters not always available in render phase

    Mauro Lopez Newbie

      "Hello":

       

      The following portlet example shows the value of the "renderParameter" PRP (public render parameter), and if the submit button is pressed, sets it to the value "Hello":

       

       

      public class MyPortlet extends GenericPortlet {


          private static final String RENDER_PARAMETER = "renderParameter";


          @Override
          protected void doView(RenderRequest request, RenderResponse response)

                  throws PortletException, IOException {
              response.setContentType("text/html");
             
              String actionURL = response.createActionURL().toString();
             
              PrintWriter out = response.getWriter();
             
              out.print("render parameter value is: " + request.getParameter(RENDER_PARAMETER));
              out.print("<form method=POST action=" + actionURL + "><input type=submit value=Subir></form>");
          }


          @Override
          public void processAction(ActionRequest request, ActionResponse response)

                 throws PortletException, IOException {
              response.setRenderParameter(RENDER_PARAMETER, "Hello");
          }   
         
      }

       

       

      <portlet>
          <portlet-name>MyPortlet</portlet-name>
          <portlet-class>test.MyPortlet</portlet-class>
          <expiration-cache>-0</expiration-cache>
          <supports>
              <mime-type>text/html</mime-type>
              <portlet-mode>VIEW</portlet-mode>
          </supports>
          <portlet-info> 
              <title>MyPortlet</title>
          </portlet-info>
         
          <supported-public-render-parameter>renderParameter</supported-public-render-parameter>
      </portlet>


      <public-render-parameter>
          <identifier>renderParameter</identifier>
          <qname xmlns:x="http://www.happyportlet.com/public-render-parameters">x:renderParameter</qname>
      </public-render-parameter>

       

       

      After the button is pressed, the PRP is set, and (at least) the following actions will NOT UNSET it:

      1. maximizing/restoring the portlet window
      2. playing with other portlets (of course, the other portlets do not use this particular PRP)
      3. Navigate to other pages, and then return (e.g. clicking pages in the navigation bar)

       

      This is, I think, the expected behaviour, since any PRP (as any other render parameter) should be available, once set, after any subsequent render phase.

       

      Well, this was the situation with jboss portal 2.7.0, but in portal 2.7.2, when you play around with the pages in the navigation bar, the PRP is lost.

       

      Is this a bug? Do you know how to get 2.7.2 behave like 2.7.0?

       

       

      Thanks!