2 Replies Latest reply on Jul 15, 2009 4:17 AM by hilmer

    windowState not set on ActionRequest

    hilmer

      Hi

      I am creating a PortletUrl using this piece of code in my doView method

       PortletURL portlet_url = resp.createActionURL();
       portlet_url.setWindowState(WindowState.MINIMIZED);
       portlet_url.setPortletMode(PortletMode.VIEW);
      


      The resulting url is then used as the action url in a form submit.
      Upon activation of the form's submit I would expect that in the processAction method actionRequest.getWindowState() would return WindowState.MINIMIZED, as this is what the url indicates.
      But instead I get WindowState.NORMAL.
      I consider this a bug, but maybe I have misunderstood something in the portlet spec.

      I am running on a build of the branch JBoss_Portal_Branch_2_7_AS5 on JBoss AS 5.1GA

      --Soren

        • 1. Re: windowState not set on ActionRequest

          I think JSR168/286 define that the WindowState change won't be propagated until the subsequent RenderRequest (after your ActionRequest).

          From JSR286:

          The setWindowState method allows a portlet to change its current window state. The new window state will be effective in the following processEvent and render requests.


          • 2. Re: windowState not set on ActionRequest
            hilmer

            Okay

            I simply do a return from my processAction and then, (according to the spec), in the subsequent doView call renderRequest.getWindowState() should return WindowState.MINIMIZED, but it also returns WindowState.NORMAL, so then the bug lies here?

            What does work is if you call actionResponse.setWindowState(WindowState.MINIMIZED) in processAction, in this case the doView is not called at all, and the portlet is indeed minimized.
            But if this is how it is supposed to work I really need a way to check the incomming actionRequest for the windowstate parameter.

            Something like:

            if (actionRequest.getWindowState() == WindowState.MINIMIZED)
             actionResponse.setWindowState(WindowState.MINIMIZED)
            


            But as stated before this does not work.

            To me there is definitely a bug somewhere.

            --Soren