Skip to content

Latest commit

 

History

History
277 lines (193 loc) · 8.97 KB

Portlet.rst

File metadata and controls

277 lines (193 loc) · 8.97 KB

dojox.widget.Portlet

Project owner

Shane O'Sullivan

since

1.3.2

The dojox.widget.Portlet is an enhanced version of the dijit.TitlePane widget, designed to be used in the dojox.layout.GridContainer.

Introduction

The Portlet widget adds enhanced features to the dijit.TitlePane widget. It adds the ability to close (remove) the widget from a GridContainer, and also to have configurable settings.

The settings types included are:

  • dojox.widget.PortletSettings The base settings widget. Places the settings at the top of the Portlet, which slide into view when the settings icon is pressed.
  • dojox.widget.PortletDialogSettings Displays the settings is a pop up modal dialog.
  • dojox.widget.PortletFeedSettings The settings widget to be used with the dojox.widget.FeedPortlet. It can be a simple text input displaying the URL to an Atom or RSS feed, or a select node displaying multiple feeds to load.

It is worth noting that this widget just implements one possible front end of a Portlet. The JSR-168 standard for Portlets contains a lot more than this. A full Portlet implementation requires both server side and client side code. This widget only serves to present the Portlet on the client side.

Usage

Examples

Basic Portlet

This example shows a very simplistic Portlet, with just a simple PortletSettings widget and text content.

Load the Portlet JavaScript.

Basic Feed Portlet

This example shows a FeedPortlet with a single URL. A FeedPortlet is an extension of Portlet, and can be used to load an 'Atom <http://en.wikipedia.org/wiki/Atom_(standard)>'_ or 'RSS <http://en.wikipedia.org/wiki/RSS>'_ feed and display it as a list. The FeedPortlet displays the titles of the feed items, and shows the contents of each item, or story, in a tooltip when the mouse hovers over it.

Load the Portlet JavaScript.

Expandable Feed Portlet With Multiple URLs

An ExpandableFeedPortlet is an extension of FeedPortlet. Like FeedPortlet it can load an Atom or RSS feed from a URL, however it displays the feed items in a list with an icons placed to the left of each item. When an icon is clicked, the content of the item, or story, is shown. This is different from the FeedPortlet, which displays the content in a tooltip.

This example also shows the dojox.widget.PortletFeedSettings widget being used with multiple URLs. If the PortletFeedSettings is created as a SELECT node, it will display multiple URLs to the user, along with labels which are more readable than URLs.

Load the Portlet JavaScript.

Portlets In A Grid Container

This examples shows Portlets as they are intended to be used, inside a dojox.layout.GridContainer. It shows three Portlets, all of which can be dragged around the page.

Load the Portlet and GridContainer JavaScript.

Include the CSS for the Portlet, the GridContainer, and the Calendar widgets.

This example includes three Portlets in a GridContainer. The GridContainer lays out the widgets in a grid enables dragging them around. The GridContainer in this example has two columns, set using the 'nbZones' attribute. This example also shows the Calendar Portlet containing another Dojo widget, the dojox.widget.Calendar.

See also

  • dojox.layout.GridContainer <dojox/layout/GridContainer>