I'm sure it's an easy thing, but I can't find it anywhere. How do I programatically make a portlet inside of Liferay go into Full Screen Mode. eg: the equivalent of clicking on the maximise button, but in code rather than having to make the user manually click that button.
Web apps in Liferay DXP are called portlets. Like many web apps, portlets process requests and generate responses. In the response, the portlet returns content (e.g. HTML, XHTML) for display in browsers.
On Liferay Portal 6.2 EE, if one would like to make the title of a portlet non-visible, an easy way is to set an empty string ('') as title.
You can set window state in the action phase. ActionResponse interface has method setWindowState().
You cannot change the state in the render phase -- try to imagine what would happened if two or more portlets decided to maximize themself.
Inside processAction(..)
:
actionResponse.setWindowState(WindowState.MAXIMIZED);
inside doView(..)
:
renderRequest.setWindowState(WindowState.MAXIMIZED);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With