Forums de discussion

Portlet loses format in EXCLUSIVE Window State

tom aronsons, modifié il y a 12 années.

Portlet loses format in EXCLUSIVE Window State

New Member Publications: 21 Date d'inscription: 29/04/11 Publications récentes
When I load my portlet through ajax or popup in exclusive mode, I lose all the css and javascript in that portlet. For example, loading portlet id 2 (My Account, part of liferay core) would look like the following instead of the one on the last one:
thumbnail
Ryan Park, modifié il y a 12 années.

RE: Portlet loses format in EXCLUSIVE Window State

Regular Member Publications: 120 Date d'inscription: 28/08/07 Publications récentes
Hi Tom,

This is correct, when you load via the exclusive window state, Liferay only sends back the HTML segment for the JSP the link points to so this excludes the CSS or JS.

If you're trying to load it into a popup window I would try the "LiferayWindowState.POP_UP" which will return your JSP page wrapped with HTML\HEAD\BODY tags and include the CSS and JS (i believe), otherwise you'll have to load these items manually.

Hope this helps!
tom aronsons, modifié il y a 12 années.

RE: Portlet loses format in EXCLUSIVE Window State

New Member Publications: 21 Date d'inscription: 29/04/11 Publications récentes
I've tried to look for the css and js but no luck getting them to work.
I've include html\portlet\enterprise_admin.css.jsp, the main.css in theme. I can't even find the javascript file for this page.

What do you think about this method? Requesting the portlet in LiferayWindowState.MAXIMIZED will return the whole website with the portlet maximized with all the correct formats, so in my theme, I'll just check if the request is an ajax for a maximized portlet, and exclude everything else (header/footer) except the portlet.