Reputation: 156
I have a Liferay portal custom theme, which is embedding a portlet in the left-side section through some standard Velocity code in portal_normal.vm. When I first embedded the portlet, I set the property portlet-setup-show-borders-default to "false", which caused the portlet to render without the title bar or other "chrome" (which is not what I wanted).
I changed the property value to "true", but what I found is that on the pages where I had already loaded the portlet, it continued to render without the borders and "chrome". If I loaded a different page, however, the portlet then rendered correctly.
How do I force Liferay to re-draw the portlet correctly on those first pages that I had visited? I can't find anything in the Admin GUI (which is what I'd prefer) that might force some cached copy of it to be cleared, and a lot of Google searching hasn't showed anything that works, either. I had found one article that looked like it might work ( http://www.liferay.com/community/forums/-/message_boards/message/772138 ), but the code posted by Artur in the second comment doesn't work for a general portlet, just the Web Content portlet and articles.
Has anyone else run into this and found a solution? Please let me know ASAP!
Thanks in advance
-- Joe --
Upvotes: 1
Views: 2577
Reputation: 156
Finally found the information I needed on Liferay's community forums site, though it required a very specific search term in Google to locate it. Sharing the information here so others will have it more readily (I hope).
When a portlet is embedded in a theme, each page that's loaded for that theme has the VelocityPortletPreferences settings stored in the PortletPreferences table of the database. Even if you change the preference settings inside the template code for your theme, Liferay will ignore the change and use the stored preference values from the DB. The only way to clear out these stored values is to delete the rows in the PortletPreferences table corresponding to your portlet's ID.
delete from PortletPreferences where portletId = '<your-portlet-id-here>'
Once you've done this (no restart of the Liferay service is needed), you can reload the pages that were not displaying properly and they will now pick up the updated preference settings.
Note that the updated preferences will once again be stored in the database after you reload the pages, so if you need to make another change, you'll have to delete the rows for that portlet once again.
Upvotes: 2