The portlet spec is your friend:
PLT.7.1.1 Including a Portlet Mode or a Window State
A portlet URL can include a specific portlet mode (see PLT.8 Portlet Modes Chapter) or
window state (see PLT.9 Window States Chapter). The PortletURL interface has the
setWindowState and setPortletMode methods for setting the portlet mode and window
state in the portlet URL. For example:
PortletURL url = response.createActionURL();
writer.print(?<FORM METHOD=\?POST\? ACTION=\??+ url.toString()+?\?>?);
Assume that whenever the edit button is clicked on the portlet, the portlet has to be displayed in maximized mode. Here the user is not clicking on a portlet url but the standard edit button of the portlet window.
since the maximize has to happen everytime, I thought of putting the code in the doEdit(...) method. I see that the ActionResponse has the method setWindowState() but not the RenderResponse.
so my code should look something like
protected void doEdit(RenderRequest request, RenderResponse response)
throws PortletException, IOException
// ** put code to maximize the window. **
// Edit View logic goes here.
Yes, you can only change the state in the action method. In the render method it is already too late so you cannot do what you are looking for.