留言板
Have to Refresh Page Twice to See PortletPreference Changes
Syed Aslam,修改在7 年前。
Have to Refresh Page Twice to See PortletPreference Changes
New Member 帖子: 13 加入日期: 16-3-17 最近的帖子
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