-
1. Re: MyFaces portlet and windowstate ?
smoyer Apr 25, 2006 9:16 PM (in response to cpage)I'm also just starting with JSF based portlets but can say that I'm not having this problem. The Portal takes care of rendering everything with the correct WindowState before your Portlet is actually called. If you click the "maximize" control, the Portal rerenders the page with the appropriate layout and passes control into your render methods to create the content of the window.
You should only need to grab the WindowState during the JSF processing if you're rendering different output depending on the space allocated to the window. You can do this within your JSF file with the following snippet (which only shows the current WindowState ... insert your own logic to decide how to use it):<%@ taglib uri="http://java.sun.com/portlet" prefix="p"%> <p:defineObjects/> <%=renderResponse.getWindowState()%>
The taglib and defineObjects lines must both occur before you try to access any of the Portlet's objects. If you're trying to programatically change WindowState, I believe that you'll need to complete that code in the Portlet class (before any rendering starts).
Am I misunderstanding your problem? -
2. Re: MyFaces portlet and windowstate ?
cpage Apr 26, 2006 3:55 AM (in response to cpage)it is not really my problem :p
because i don't want to change the content of the page depending on the windowstate but i want to change the entire page.
if portlet is in state normal: i render page1.jsp
if portlet is in state maximized: i render page2.jsp
(=> i realised this with a DefaultViewSelector)
then, i can have a commandbutton on my page "page1.jsp".
if i click on it, i have to go to the page "page3.jsp" (navigation rules) and this page have to render in state maximized.
the only way to change the windowstate is in the Actionresponse (actionresponse.setWindowState(...))
but i don't think it is the good way to do this. -
3. Re: MyFaces portlet and windowstate ?
roy.russo Apr 26, 2006 2:09 PM (in response to cpage)So subclass the MyFaceGenericPortlet, and add this logic to your new render method.
-
4. Re: MyFaces portlet and windowstate ?
cpage Apr 26, 2006 2:37 PM (in response to cpage)"roy.russo@jboss.com" wrote:
So subclass the MyFaceGenericPortlet, and add this logic to your new render method.
yes, this is what i have done.
i override the render method and also, the processaction method, to access the actionresponse.setWindowState.
i get the name of the view_ID (the name of my jsf page) and with my naming rule I set the windowstate.
i just looking for other way to realise that, properly ! :D
thanks ;)