*
The moose likes Portals and Portlets and the fly likes Settings for portlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Settings for portlet" Watch "Settings for portlet" New topic
Author

Settings for portlet

Roberto Campione
Greenhorn

Joined: Nov 13, 2008
Posts: 1
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

Joined: Jul 09, 2008
Posts: 14
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.


Perception Matters.
S R I
Bigwood Liu
Ranch Hand

Joined: Feb 26, 2003
Posts: 240
Using PortletPreference!

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


[ December 17, 2008: Message edited by: damu liu ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Settings for portlet
 
Similar Threads
Basics Help need for Portlet development
Portel to portel communication
Unable to show/hide JSF portlets
Websphere Portal - Test 399
navigation between the pages in different portlets using JSR286