掲示板

Have to Refresh Page Twice to See PortletPreference Changes

7年前 に Syed Aslam によって更新されました。

Have to Refresh Page Twice to See PortletPreference Changes

New Member 投稿: 13 参加年月日: 16/03/17 最新の投稿
Hi,
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