Preference value lost

In our application we have a preference defined for the Results portlet which should be stored on the session. The declaration in wm-portlet.xml is the following:

currentTaskID
Current Task ID

session
false
String

I set the value of preference when I open a task from the Results list in order to see the Details page. When I come back from the Details page, the value of the preference is lost.

I want to use this preference in order to mark the task from the results table that was clicked on for opening the Details page.

I also have another preference with the same name for a different portlet. I have renamed that second preference but the value of the one from the Result portlet is still lost.

Do you call storePreferences() on your Portlet class (the class that extends BaseFacesPreferencesBean)?

Regards,
–mark

In all the classes that extend BaseFacesPreferencesBean I have a “storePreferences()” method that looks like this:

public void storePrefernces() throws Exception{
updatePreferences();
PortletPreferences preferences = getPreferences();
preferences.store();
}

I have also tried to invoice this method in the setter of the preference at it still does not work.

I’ve attached a sample that demonstrates this technique.

To use the sample please do the following:

  1. Deploy the TestPreferencesApp.war
  2. Login as Administrator and using the Task Engine Administration UI start a few of the Test Preference Tasks. Make sure to fill in the sample field in the Task Start UI
  3. Browse to the Task List Management and assign all of those tasks to the Administrator user
  4. Browse to the custom Test Preferences Inbox and notice the Sample Fields in the task column as well as the empty preference displayed for the current portlet
  5. Click on one of the tasks. That will eventually invoke a method i wrote: setPreferenceFromCurrentTask()
  6. In the details page of the task, confirm the preference that was set and click return
  7. back in the inbox results portlet you should see the stored session based preference that was set in step #5

Regards,
–mark
TaskPreferencesApp.zip (56.9 KB)