dojox.widget.Portlet¶
Status: | Draft |
---|---|
Version: | 1.0 |
Project owner: | Shane O’Sullivan |
Available: | 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¶
<div dojoType="dojox.widget.Portlet" title="My Flickr">
<div dojoType="dojox.widget.PortletSettings">
<div dojoType="dojox.layout.TableContainer" cols="1">
<div dojoType="dijit.form.TextBox" title="Option 3"></div>
<div dojoType="dijit.form.TextBox" title="Option 4"></div>
</div>
</div>
<div>
The Contents of the portlet go here
</div>
</div>
Examples¶
Basic Portlet¶
This example shows a very simplistic Portlet, with just a simple PortletSettings widget and text content.
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.
Expandable Feed Portlet With Multiple URLs¶
An ExpandableFeedPortlet is an extenstion 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.
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.