Forums de discussion
Have to Refresh Page Twice to See PortletPreference Changes
Syed Aslam, modifié il y a 7 années.
Have to Refresh Page Twice to See PortletPreference Changes
New Member Publications: 13 Date d'inscription: 17/03/16 Publications récentes
Hi,
This is what I am doing:
1. Embedding a portlet with $theme.runtime():
2. Getting the preferences of that embedded portlet and resetting all of the preferences:
3. Setting different PortletPreferences to this portlet:
The issue is that the new preferences that I am loading (in step 3) are only being reflected after I refresh my browser two times. I have no idea what could be the issue here.
Thanks
This is what I am doing:
1. Embedding a portlet with $theme.runtime():
$velocityPortletPreferences.setValue('portlet-setup-show-borders', 'false')
$theme.runtime($portletId, "", $velocityPortletPreferences.toString())
$velocityPortletPreferences.reset()
2. Getting the preferences of that embedded portlet and resetting all of the preferences:
#set ($portletSetup = $portletPreferencesFactoryUtil.getLayoutPortletSetup($themeDisplay.getLayout(), $portletId))
#set ($portletSetupMap = $portletSetup.getMap() )
#set ($portletSetupKeyset = $portletSetupMap.keySet() )
#foreach($key in $portletSetupKeyset)
$portletSetup.reset($key)
#end
$portletSetup.store()
3. Setting different PortletPreferences to this portlet:
#foreach($key in $archivedPrefsKeyset) ## $archivedPrefsKeyset is the keyset of the preferences that I want to load
#set ($archivedVal = $archivedPrefsMap.get($key) )
$portletSetup.setValues($key, $archivedVal)
#end
$portletSetup.store()
The issue is that the new preferences that I am loading (in step 3) are only being reflected after I refresh my browser two times. I have no idea what could be the issue here.
Thanks