• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Settings for portlet

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I'm relatively new with portal and portlets so I'll explain this as best I can.

I have a portlet, say a View portlet, that changes it's view based on a user setting. There could be numerous View portlets, each with their own setting - i.e. one would show a list of 10, the other a list of 20 etc.

The user sets the number of list items.

Question: How do I store this value to be unique to a individual portlet? So if I set a value on View portlet A, I don't want it to be set of View portlet B.

I've tried a number of options:

- PortletPreferences
- PortletSession
- PortletContext

but none of them suit my needs.

Anybody got any ideas?
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want the user to enter his settings and want the portlet to modify its view based on these seetings, then the best option would be to use the configure/personalize/edit mode of the portlet, which you set while creating the portlet or can add from the portlet.xml file.

The other option would be to have a portlet preference set and make copies of your portlet as many as you want and set the value of this preference for each portlet.
Thus each portlet has its own setting and displays its own view.
 
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using PortletPreference!

Implement doEdit, using PortletPreference, remember to call "store" method on your portletPreference.


[ December 17, 2008: Message edited by: damu liu ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic