-
1. Re: Can't change WindowState in processAction or processEvent
hoang_to Aug 26, 2010 11:57 AM (in response to phdezann)Please give details of how did you debug
As i know, in GateIn 3.1, the render request is not invoked if the window state is MINIMIZED. That might explain why in this special case, window state parameter of a render request is not coherent to window state changes in preceding action/event requests.
-
2. Re: Can't change WindowState in processAction or processEvent
phdezann Aug 26, 2010 12:56 PM (in response to hoang_to)Thanks for your quick reply.
Note that I don't click on any icons for maximizing or minimizing a portlet. What I want to do is to minimize a portlet from an event sent by another portlet (both portlets being on the same page).
Here is the scenario :
- The user clicks on a link on the PortletA and triggers an action
- The action sends an event
- The PortletB receives the event sent by the PortletA and calls setWindowState(WindowState.MINIMIZED) on the EventResponse object
At this point, the PortletA should be displayed and the PortletB minimized, right?
The behavious I have is that the doView method of the PortletB is still called and this call is made with a WindowState set to WindowState.NORMAL. Consequently PortletB renders its ouput.
Nevertheless, the JSR 286 states the following :
PLT.12.2.2 Portlet Modes and Window State Changes...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. If a portlet attempts to set a window state that it is not allowed to switch to, a WindowStateException must be thrown.Portlets cannot assume that subsequent processEvent or render calls will be called with the set portlet mode or window state as the portal/portlet-container could override these changes.Does this last paragraph mean that the portal must be configured to pass the WindowState set in the processAction or in the processEvent to the render call ?
-
3. Re: Can't change WindowState in processAction or processEvent
hoang_to Aug 26, 2010 10:49 PM (in response to phdezann)In GateIn, each portlet window is represented by an UIPortlet object. The request handling flow on an UIPortlet is described as following:
1. User trigger an action on the UI component UIPortlet
2. UI Event (ex: change mode, window states of the UIPortlet component) is fired, relevant event listener reset the states of UIPortlet object
3. 'ProcessAction' UI Event is fired, that makes an Action Invocation tobe sent to Portlet Container ( parameters of ActionRequest are taken from UIPortlet object), that might result in portlet event requests
4. UIPortlet is added to 'update by AJAX' UI components, processRender method of the UIPortlet is called
5. Render Invocation is sent to Portlet Container (parameters of RenderRequest are taken from UIPortlet object) (*)
Upto 3.1 release, there is no (*) if WindowState of UIPortlet object is MINIMIZED
So please debug to see if the WindowState of UIPortlet object representing your porltet window B is set to MINIMIZED
-
4. Re: Can't change WindowState in processAction or processEvent
trong.tran Aug 27, 2010 12:48 AM (in response to phdezann)Hi Pierre-Henri,
This is definitely a bug. Actually i have tried to setWindowState in an ActionURL but it does not work too.
I have addressed this to a JIRA https://jira.jboss.org/browse/GTNPORTAL-1446, so you can watch its activity
Thanks for your experiment.
-
5. Re: Can't change WindowState in processAction or processEvent
phdezann Aug 27, 2010 3:59 AM (in response to trong.tran)Thank you very much for this.