Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

With whatever link you want to change modes, you need a PortletURL. Simply create the URL normally (PortletURL myPortletURL = response.createRenderURL()), then call the method: myPortletURL.setPortletMode(PortletMode.EDIT) for edit mode, or use VIEW for view mode and HELP for help mode... If you're extending the GenericPortlet, you then just have to implement doView(), doHelp(), and doEdit() each method will get called accordingly. You can also set your window states if you want to by calling myPortletURL.setWindowState(WindowState.MAXIMIZED) etc...

With thanks to Keith Zantow of VT for answering this question on the uPortal list.

Changing portlet mode programmatically

Code Block
java
java

actionResponse.setPortletMode(PortletMode.EDIT);