How to programmatically make a Liferay portlet in full screen

I am sure it is easy, but I can not find it anywhere. How to programmatically make a portlet inside Liferay go to full screen mode. for example: the equivalent of clicking the maximize button, but in the code, instead of forcing the user to manually click this button.

+5
source share
2 answers

You can set the window state in the action phase. The ActionResponse interface has a setWindowState () method.

You cannot change state in the rendering phase - try to imagine what will happen if two or more portlets decide to maximize themselves.

+9
source

processAction(..):

actionResponse.setWindowState(WindowState.MAXIMIZED);

doView(..):

renderRequest.setWindowState(WindowState.MAXIMIZED);
+1

All Articles