• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Settings for portlet

 
Roberto Campione
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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?
 
srinivas bodapati
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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.
 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic