Overview
The GridSphere UI tag and visual bean library makes it easier to develop portlets using the GridSphere Action Portlet provider model described in the Tutorial. The UI tag library is used to construct interfaces as visual components that wrap underlying HTML elements with a default look and feel in your JSP. The visual beans provide bean representations of the tags to be used in portlets for action handling or presentation logic. The UI tag library descriptor which defines tag parameters and definitions can be found in the $CATALINA_HOME/webapps/gridsphere/WEB-INF/tlds/portletui.tld directory. All tags may contain a beanId attribute. The valueof beanId is a String that identifies the tag so it may be retrieved as a visual bean in the portlet. See the Tutorial for an example. The JSR 168 Portlet Specification also specifies a collection of portlet tags that are implemented in GridSphere. Please see the specification for more details.
This reference guide is intended to summarize available UI tags and beans and highlight usage.
Importing Tag Library in JSP
The following code snippets show the imports that must be included at the beginning of a JSP page to import the UI and portlet tag libraries.
Now the tags can be used within a JSP by using the "ui" reference specified in the taglib directive. In addition JSR-168 tags can be used using the "portlet" reference.
Base Tag Attributes
In general all UI tags inherit from a BaseComponentTag which provides various attributes for setting the look and feel, labels and values. Below is a list of the basic tag attributes, however not all are used for every UI tag. The beanID tag attribute can be used in every UI tag and provides a label for accessing the tag as a visual bean from the portlet. See the section on visual beans for more details.
Attribute Name |
Required? |
Description |
| beanID |
no |
string: a label used to express this component as a visual bean that can be made available to the portlet. |
| cssStyle |
no |
string: allows you to add an inline CSS style |
| cssClass |
no |
string: allows you to add an inline CSS class |
id |
no |
string: a unique id that refers to the tag element, useful for javascript operations i.e. getElementById(id) |
Important: Due to the way that GridSphere encodes beans, you MUST NOT use "_" in the beanID variables!
Javascript Events
Some elements also support the following javascript event handlers specified as tag attributes:
- onMouseUp
- onMouseMove
- onMouseDown
- onMouseOut
- onMouseOver
- onBlur
- onFocus
- onSelect
- onChange
- onClick
- onDblClick
- onSubmit
- onReset
|
There is no documentation in here for the ui:hasrole tag, despite it having been defined in the tld. In addition, the tlds are located in {{$CATALINA_HOME/webapps/gridsphere/META-INF/tlds/, not in WEB-INF as described above.
}}