This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Portals and Portlets and the fly likes Portlet modes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Portlet modes" Watch "Portlet modes" New topic

Portlet modes

Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
Suppose I have a portlet that shows me some info about a person from the database. I have to provide a way by which the info can be edited as well by the logged in user.

So what is the best way to do it. Should an edit link be provided in the portlet or should this be done in the edit portlet mode, or in the configure mode?

I am using Struts 1.1., JSR-168 portlets on RAD 6.0

Saravanan Mahalingam

Joined: May 18, 2006
Posts: 4
I suggest that your first option is best one. You can add Edit link/button to do this functionality in View mode itself. Most commonly edit mode can be used for setting up the user preferences. For e.g., if you want to restrict number of user records to be displayed in the view mode, you can provide a text box in Edit mode in which user can give number of records to be displayed.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Let's turn this into a philisophical argument.

What is the purpose of the edit mode? I'd say that the purpose of the edit mode it to change how the portlet itself renders, displays, or behaves. The edit mode is really designed to edit the portlet, and portlet properties, not necessarily the data displayed in the portlet.

So, if I have a person details portlet, to me, the edit mode might do things like add a new field to display about the user, or the edit mode might be used to remove the 'middle-name' textfield on the portlet. But can you see how, philisophically, the edit button is being used to change the behavior of the PORTLET, and not change the behavior or the state of the data in which the portlet resides.

The data being displayed about a user in a portlet is NOT a property of the portlet. My name is NOT a portlet preference. If I want to change my last name, I shouldn't have to the edit mode of the portlet, because my name has nothing to do with the portlet. If I want to edit my name, there should be a button on the view mode of the portlet that allows me to update my personal information.

Is what I'm saying making sense?

To me, the edit mode is designed to edit the portlet, and how the portlet does certain things.

-Cameron McKenzie
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Please check your private messages.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Portlet modes
jQuery in Action, 3rd edition