Portlet Modes Available in uPortal
The modes currently available to uPortal portlets are:
- view
- edit
- help
Edit Mode
- Use the edit PortletMode to display a form with the configuration screen you want users to see (in this case just a URL input)
- A portlet can use the PortletPreference API to modify preferences during an ActionRequest so make the configuration form POST to an action URL and change the URL preference value.
- Render an 'edit' link or button when in the view PortletMode that takes the user to the edit PortletMode.
Switching between portlet modes
Changing portlet mode through URLs
The most common method of switching portlet modes is through a URL. For example, you might create an "edit" URL that when clicked, sends the user to the portlet's edit mode. Portlet mode-switching links may be created through the use of the portlet JSP tag library:
<portlet:renderURL mode="edit"/>
It is also possible to create a URL which will switch the mode of a portlet through direct use of the Java API:
PortletURL myPortletURL = response.createRenderURL(); myPortletURL.setPortletMode(PortletModeEDIT);
Window states may also be set via either the JSP tag or Java API.
Changing portlet mode programmatically
actionResponse.setPortletMode(PortletMode.EDIT);