Tomahawk tag library 1.2.


Standard Syntax:
     <%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk" %>

XML Syntax:
     <anyxmlelement xmlns:t="http://myfaces.apache.org/tomahawk" />

MyFaces subproject that contains components and other goodies to be used with any JSF implementation.

Tag Library Information
Display NameTomahawk tag library 1.2.
Version1.1.7
Short Namet
URIhttp://myfaces.apache.org/tomahawk
 

Tag Summary
commandButtonExtends standard commandButton by user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
commandLinkExtends standard commandLink by user role support and the HTML target attribute. Unless otherwise specified, all attributes accept static values or EL expressions.
dataTableThe MyFacesDataTable extends the standard JSF DataTable by two important features:
  • Possiblity to save the state of the DataModel.
  • Support for clickable sort headers (see SortHeader component).

Extended data_table that adds some additional features to the standard data_table action: see attribute descriptions for preserveDataModel, sortColumn, sortAscending and preserveSort.
Unless otherwise specified, all attributes accept static values or EL expressions.
graphicImageExtends standard graphicImage. Unless otherwise specified, all attributes accept static values or EL expressions.
inputHiddenExtended version of {@link javax.faces.component.html.HtmlInputHidden} that provides additional MyFaces functionality.
inputSecretExtends standard inputSecret, adding the "redisplay" property. Unless otherwise specified, all attributes accept static values or EL expressions.
inputTextExtends standard inputText by user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
inputTextareaExtends standard inputTextarea by user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
messageMyFaces extension to the standard messages tag: see summaryDetailSeparator attribute. Unless otherwise specified, all attributes accept static values or EL expressions.
messagesMyFaces extension to the standard messages tag: see showInputLabel attribute. Unless otherwise specified, all attributes accept static values or EL expressions.
outputLabelExtends standard outputLabel with user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
outputTextExtends standard outputText with user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
panelGridExtends standard panelGrid with user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
panelGroupExtends standard panelGroup with user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
selectBooleanCheckboxExtends standard selectBooleanCheckbox with user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
selectManyCheckboxExtends standard selectManyCheckbox with user role support. Additionally this extended selectManyCheckbox accepts a layout attribute of value "spread" (see custom checkbox tag). Unless otherwise specified, all attributes accept static values or EL expressions.
selectManyListboxExtends standard selectManyListbox with user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
selectManyMenuExtends standard selectManyMenu with user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
selectOneListboxExtends standard selectOneListbox with user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
selectOneMenuExtends standard selectOneMenu with user role support. Unless otherwise specified, all attributes accept static values or EL expressions.
selectOneRadioImplements the standard html selectOneRadio tag, with additional features. Supports user roles. Supports the "spread" layout value, which gives developer control over radio button positioning. See the "layout" attribute and the "radio" tag for further information. Unless otherwise specified, all attributes accept static values or EL expressions.
aliasBeanThe aliasBean tag allows you to create a temporary name for a real bean. The temporary name exists (is visible) only to the children of the aliasBean.

One use of this feature is to pass "parameters" from an including page to an included one. The included page can use any name it desires for beans it needs to reference, and the including page can then use aliasBean to make those names refer to the beans it wishes to "pass" as parameters.

Suppose you have a block of components you use often but with different beans. You can create a separate JSP page (or equivalent) containing these beans, where the value-bindings refer to some fictive bean name. Document these names as the required "parameters" for this JSP page. Wherever you wish to use this block you then declare an alias component mapping each of these "parameters" to whatever beans (or literal values) you really want to apply the block to, then use jsp:include (or equivalent) to include the reusable block of components.

Note, however, that AliasBean does not work for component bindings; JSF1.1 just has no mechanism available to set up the alias during the "restore view" phase while the bindings of its children are being re-established, and then remove the alias after the child bindings are done.

As a special case, if this component's direct parent is an AliasBeansScope then the alias (temporary name) is active until the end of the parent component, rather than the end of this component.

aliasBeansScopeHolds several aliases that are configured by aliasBean tags.

The aliasBean tag must enclose all the components that are within the scope of the alias. When multiple aliasas are defined, this makes the page structure very clumsy; for example defining 5 aliases means the content must be nested 5 indentation levels deep. This tag instead allows the content block to be wrapped in just one AliasBeansScope tag, and then have AliasBean tags with empty bodies added as direct children of this component. The scope of the AliasBean tag still starts when the tag begins, but instead of ending when the tag ends the scope of the nested AliasBean tags extends to the end of this component.

bufferA component that renders its child components into an in-memory buffer rather than render them directly to the response stream.

Property "into" is an EL expression that specifies where to store a String holding the results of rendering all the children of this component; this is assigned to after rendering of this component (and its children) is complete.

Typically, an h:output tag is then used later in the same page to output the buffer contents.

This can be useful with JSF1.1/JSP2.0 to work around the well-known problem where on first render of a page, a component "A" cannot reference a component "B" which is defined later in the page because it has not yet been created. A solution is to define "B" before "A", but wrapped in a Buffer component. Component A can then be rendered and successfully reference "B" because it now exists. And later in the page, the buffer contents can then be output, preserving the original layout.

This can also be useful when rendering the same data block multiple times within a page. For example, a datatable can be rendered with a datascroller both before and after it; first render the table into a buffer B1, then render the datascroller into a buffer B2, then output buffers B2,B1,B2.

inputCalendar

Provides a calendar. The calendar can be "inline", or a button can be rendered that displays the calendar in a "popup window" when clicked. Javascript is required for the popup window.

The two forms of calendar are unfortunately not well integrated; this component is effectively two components that happen to use the same component class. Some attributes on the component are applicable only to the inline form while others are applicable only to the popup form.

The appearance of the inline calendar can be controlled via attributes such as currentDayCellClass, dayCellClass, weekRowClass, monthYearRowClass. Attributes "styleLocation", "javascriptLocation", "imageLocation" and all attributes starting with "popup" have no effect on an inline calendar.

    The appearance of the popup calendar can be controlled via attributes popupTheme, styleLocation, javascriptLocation and imageLocation:

  • popupTheme: When styleLocation is not overridden then this selects one of the built-in themes ("WH" or "DB"); the default is "DB". This also selects the prefix used for the names of style classes attached to generated dom elements; all style names are of form "jscalendar-{popupTheme}-*".
  • styleLocation: specifies the URL of a directory in which a "theme.css" file exists. A reference to this theme.css file will automatically be output. Specifying "none" as the location prevents the generation of this stylesheet reference; it is assumed that the necessary style rules will be loaded via some other mechanism. Defaults to a reference to a location within the tomahawk jarfile which varies based on popupTheme.
  • javascriptLocation: specifies the URL of a directory in which all the necessary script files can be found. A reference to scripts "prototype.js", "date.js" and "popcalendar.js" will automatically be output. Specifying "none" prevents generation of these references; it is assumed that the necessary javascript functions will be loaded via some other mechanism. Defaults to a reference to a location within the tomahawk jarfile.
  • imageLocation: specifies the URL of a directory in which all the necessary icons are defined. Defaults to a reference to a location within the tomahawk jarfile which varies depending on popupTheme.
Other styling attributes (eg dayCellClass, weekRowClass) are ignored for the popup calendar.

Unless otherwise specified, all attributes accept static values or EL expressions.

captchaNo Description
checkboxRenders a HTML input of type "checkbox". The associated SelectItem comes from an extended selectManyCheckbox component with layout "spread". The selectManyCheckbox is referenced by the "for" attribute. All HTML pass-through attributes for this input are taken from the associated selectManyCheckbox. Unless otherwise specified, all attributes accept static values or EL expressions.
collapsiblePanelA component which just renders as a single icon (with optional label) when "collapsed", hiding all child components. When open, the child components can be seen. The title attribute defines the label shown for the collapsible panel.
headerLinkLink used to collapse or expand a t:collapsiblePanel. Unless otherwise specified, all attributes accept static values or EL expressions.
columnA tag that extend h:column to provide HTML passthrough attributes. Tag t:column can be used instead of h:column in a t:datatable. It provides HTML passthrough attributes for header (th), footer (td) and row cells (td). Unless otherwise specified, all attributes accept static values or EL expressions.
columnsThe tag allows dynamic columns in a datatable. The UIColumns component is used below a t:datatable to create a dynamic count of columns. It is used like a UIData component which iterates through a datamodel to create the columns. Unless otherwise specified, all attributes accept static values or EL expressions.
dataListSimilar to dataTable, but does not render a table. Instead the layout attribute controls how each dataRow is rendered. Unless otherwise specified, all attributes accept static values or EL expressions.
dataScrollerScroller for UIData components eg. dataTable Must be nested inside footer facet of dataTable OR for attribute must be given so that corresponding uiData can be found. Unless otherwise specified, all attributes accept static values or EL expressions. A component which works together with a UIData component to allow a user to view a large list of data one "page" at a time, and navigate between pages.
inputDateCustom input control for dates and times. Unless otherwise specified, all attributes accept static values or EL expressions.
divPlaces a div around its children. Unless otherwise specified, all attributes accept static values or EL expressions.
documentBodyDocument to enclose the document body. If not otherwise possible you can use state="start|end" to demarkate the document boundaries
documentDocument to enclose the whole document. If not otherwise possible you can use state="start|end" to demarkate the document boundaries
documentHeadDocument to enclose the document head. If not otherwise possible you can use state="start|end" to demarkate the document boundaries
dojoInitializerDefault component for the dojo intializer
This component is purely non visual, and serves for quick hacking, and prototyping the dojo toolkit within verbatimed html.
Dojo initializer helper tag for debugging and communication flags. This tag encapsules the Dojo DjConfig meta configuration and also adds the needed dojo required functionality.
fieldsetRenders an HTML Fieldset
inputFileUploadCreates a file-selection widget in the rendered page which allows a user to select a file for uploading to the server.

When the page is selected (using a command component such as commandButton), the currently selected file contents are included in the data posted to the server. The contents are cached somewhere, and an object of type UploadedFile will then be assigned to the property pointed to by the "value" expression of this component.

You must enable the Tomahawk ExtensionsFilter to make this component work (see web.xml).

Also, don't forget to set the form's attribute "enctype" to "multipart/form-data". See "examples/web/fileupload.jsp" for an example!

Unless otherwise specified, all attributes accept static values or EL expressions.

htmlTagCreates an arbitrary HTML tag which encloses any child components. The value attribute specifies the name of the generated tag.
If value is an empty string then no tag will be generated, but the child components will be rendered. This differs from setting rendered=false, which prevents child components from being rendered at all.
You can specify some attribute to be added to the component using f:param like this:
Unless otherwise specified, all attributes accept static values or EL expressions.
inputHtmlHTML Editor using the kupu library. http://kupu.oscom.org/ An inline HTML based word processor based on the Kupu library. See http://kupu.oscom.org Right now, the support is limited to one editor per page (but you can use tabs to have multiple editors, but only one rendered at a time). Unless otherwise specified, all attributes accept static values or EL expressions.
inputTextHelpExtends standard inputText by helptext support. Unless otherwise specified, all attributes accept static values or EL expressions.
jsValueChangeListenerValue change listener on client side.

This component replicates the 'Value Change Listener' functionality on the client side. It can be used when the user would like a change in the value of one control to trigger off changes in the states of other controls. One or more Javascript Listeners can be nested within the source control (a control belonging to the 'javax.faces.Input' family). When the value of the source control is modified, the listeners are triggered and the states of the target controls modified.

Unless otherwise specified, all attributes accept static values or EL expressions.

jsValueSetSetting a value from the model in java-script so that it can be used (e.g. by the value change listener) afterwards. Unless otherwise specified, all attributes accept static values or EL expressions.
panelLayoutDetermines where its children are positioned within the page relative to each other, similar to a Swing layout component. Unless otherwise specified, all attributes accept static values or EL expressions.
commandNavigationCommand, that represents a navigation item. Must be nested inside a panel_navigation action and renders a clickable navigation item. This action is derived from the standard command_link action and has equal attributes. (Replaces former "navigation_item" tag.) Unless otherwise specified, all attributes accept static values or EL expressions.
panelNavigationRenders a vertical menu structure with support for nested menu items. Unless otherwise specified, all attributes accept static values or EL expressions. Panel, that includes navigation items ({@link HtmlCommandNavigation}) and other components (separators).
navigationMenuItemsA tree of menu items as returned by a value-expression. Unless otherwise specified, all attributes accept static values or EL expressions.
navigationMenuItemA menu item. Used by navigationMenu, jscookMenu. Unless otherwise specified, all attributes accept static values or EL expressions.
commandNavigation2Must be nested inside a panel_navigation action and renders a clickable navigation item. This action is derived from the standard command_link action and has equal attributes. (Replaces former "navigation_item" tag.) Unless otherwise specified, all attributes accept static values or EL expressions. Many thanks to the guys from Swiss Federal Institute of Intellectual Property and Marc Bouquet for helping to develop this component.
panelNavigation2Renders a vertical menu structure with support for nested menu items. The menu is rendered as unordered List. The menu-tree can be dynamically build using NavigationMenuItem(s). Unless otherwise specified, all attributes accept static values or EL expressions. Many thanks to the guys from Swiss Federal Institute of Intellectual Property and Marc Bouquet for helping to develop this component.
jscookMenuRenders a Javascript Menu. Nested NavigationMenuItem(s) are rendered as Javascript Menu.

This component is based based on the excellent JSCookMenu by Heng Yuan.

Unless otherwise specified, all attributes accept static values or EL expressions.
newspaperTableModel for a table in multiple balanced columns. The newspaperTable tag allows a long, narrow table to be wrapped so that it becomes a short, wide table. This allows more information to be shown on a single screen. This is commonly used to present checkboxes for a long list of items. A data table for rendering long skinny tables as short wide table by wrapping the table over a specified number of columns. Unless otherwise specified, all attributes accept static values or EL expressions.
panelStackA stack of panels, to switch panels dynamically. Manage a stack of JSF components and allow for one child component to be choosen for rendering. The behaviour is similar to the CardLayout of Java Swing. Property selectedPanel defines the id of the child to be rendered. If no child panel is selected or if the selected panel can not be found the first child is rendered. Unless otherwise specified, all attributes accept static values or EL expressions.
selectManyPicklistA picklist component that allows to select items from one list to another

In other words, is a selection component where a set of items can be selected from a list that contains all the available items to a list that contains the selected items.

The component is based on the t:selectManyListbox component, so it contains the same attributes. Soon, more specific attributes will be added.

popupRenders a popup which displays on a mouse event. Unless otherwise specified, all attributes accept static values or EL expressions.
radioThis tag is used in conjunction with the extended selectOneRadio tag when the "spread" layout is selected. It specifies the position within the document that the radio button corresponding to a specific SelectItem should be rendered. All HTML pass-through attributes for this input are taken from the associated selectOneRadio. Unless otherwise specified, all attributes accept static values or EL expressions.
saveStateProvides the ability to store a model value inside the view's component tree.

JSF provides three scopes for managed beans and therefore all the model objects that the managed beans reference: request, session, application. However a common requirement is a way for a model object to have a scope that is tied to the duration of the current view; that is longer than the request scope but shorter than session scope.

This component simply holds a reference to an arbitrary object (specified by the value property). Because this object is an ordinary component whose scope is the current view, the reference to the model automatically has that same scope.

When the value is an EL expression, then after the view is restored the recreated target object is stored at the specified location.

The object being saved must either:

  • implement java.io.Serializable, or
  • implement javax.faces.component.StateHolder and have a default constructor.

Note that the saved object can be "chained" from view to view in order to extend its lifetime from a single view to a sequence of views if desired. A UISaveState component with an EL expression such as "#{someBean}" will save the object state after render, and restore it on postback. If navigation occurs to some other view and that view has a UISaveState component with the same EL expression then the object will simply be saved into the new view, thus extending its lifetime.

scheduleA schedule component similar to the ones found in Outlook or Evolution

Renders a schedule component, showing appointments and events in a day, workweek, week or month view, similar to the schedule part of MS Outlook or Evolution.

The component is backed by an implementation of the ScheduleModel interface. Creating a custom model can be easily achieved by implementing this interface, or by overriding the AbstractScheduleModel class.

AbstractHtmlSchedule class holds all properties specific to the HTML version of the Schedule component.

selectOneCountryA localized list of countries choose box. The value binds to the country ISO 3166 code. This is the same code as for java.util.Locale.getCountry(). The official codes list is available here : http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html Unless otherwise specified, all attributes accept static values or EL expressions.
selectOneLanguageA localized list of languages choose box. The value binds to the language ISO 639 code (lowercase). This is the same code as for java.util.Locale.getLanguage(). The official codes list is available here : http://www.loc.gov/standards/iso639-2/englangn.html Unless otherwise specified, all attributes accept static values or EL expressions.
selectOneRowEnhancement for a data-table to select one Row with a radio button. The row-index is stored in the vealu-binding
selectItemsAn extended version of the standard UISelectItems. Populates the SelectItem collection from the given value automatically using the itemLabel and itemValue attributes. By using the component there is no need to manually create a SelectItem collection because component automatically populates SelectItem objects from types like Collection, Map and etc..
commandSortHeaderClickable sort column header. Must be nested inside an extended data_table tag. This tag is derived from the standard command_link tag and has the additional attributes columnName and arrow. Note: In contrast to normal command links, the default for the "immediate" attribute is "true". This is desirable as it avoids validating all input fields in the enclosing form when the column sort order changes. HOWEVER when the table contains input components "immediate" must be set to false; otherwise input fields will render blank after a sort, or will show their old values (ie will not appear to sort though output fields in the table will sort) when sort ordering is changed. Unless otherwise specified, all attributes accept static values or EL expressions.
stylesheetRenders the path to a common CSS-file
subformA SubForm which will allow for partial validation and model update.

A subform to an existing form. Inputs in this form will only be validated and updated, if a t:commandButton or t:commandLink has been clicked with an actionFor attribute which references the client-id of this subform. Optionally, the validation will trigger if a commandButton or commandLink embedded in this subform has been clicked, except if this command is a t:commandButton or t:commandLink with an actionFor attribute which doesn't reference the client-id of this subform.

Components will be validated and updated only if either a child-component of this form caused the submit of the form, or an extended commandLink or commandButton with the actionFor attribute set to the client-id of this component was used.

You can have several comma-separated entries in the actionFor-attribute - with this it's possible to validate and update more than one subForm at once.

swapImageUnless otherwise specified, all attributes accept static values or EL expressions.
panelTabTODO: Document this component. Unless otherwise specified, all attributes accept static values or EL expressions.
panelTabbedPaneTODO: Document this component. Unless otherwise specified, all attributes accept static values or EL expressions.
toggleGroupContainer class allows user to toggle between view/edit mode. Extends PanelGroup. Allows user to have several toggleLink in a group. When the togglePanel is toggled, the toggleGroup will be hidden.
toggleLinkExtends standard outputLink but links to a dynamically rendered resource (image, file, ...). Should be nested within an HtmlToggleGroup component. Controls nested within this component will be displayed in 'view' mode, controls outside this component (within the parent HtmlToggleGroup) will be displayed in 'edit' mode.
togglePanelContainer class allows user to toggle between view/edit mode. Extends PanelGroup. Allows user to toggle between 'view' mode and 'edit' mode. In the togglePanel, include a toggleLink. When the toggleLink is clicked, the rest of the group is shown, and the link is hidden.
xmlTransformTransforms XML using and XSL stylesheet. Used to transform XML (from either a String or URL) using either XSLT or Velocity.
treeCheckboxRenders a HTML input of type "treeCheckbox". The associated comes from the treeCheckbox itemLabel and itemValue. The selected items come from an extended selectManyCheckbox component with layout "spread". The selectManyCheckbox is referenced by the "for" attribute. All HTML pass-through attributes for this input are taken from the associated selectManyCheckbox. Unless otherwise specified, all attributes accept static values or EL expressions.
treeA tree data component. Unless otherwise specified, all attributes accept static values or EL expressions.

Tree implementation based on javax.swing.JTree.

The tree model is assigned by using a value binding named model and is not stored in view state.

A hierarchy of {@link HtmlTreeNode}objects is used to represent the current expanded state of the tree. The root node is held as a faces named * rootNode.

treeColumnRenders a HTML input of type "treeColumn".

This tag outlines the column where the tree structure will be render as part of the tree table. Unless otherwise specified, all attributes accept static values or EL expressions.

Tree column model. This column is used to provide the place holder for the tree. This is used in conjunction with the table format display.

tree2Represents "tree data" in an HTML format. Also provides a mechanism for maintaining expand/collapse state of the nodes in the tree. A component that provides an HTML-based tree from data supplied by a backing bean. The tree is highly customizable and allows for fine-grained control over the appearance of each of the nodes depending on their type. Almost any type of JSF component (text, image, checkbox, etc.) can be rendered inside the nodes and there is an option for client-side or server-side toggling of the expand/collapse state. Unless otherwise specified, all attributes accept static values or EL expressions.
validateCreditCardA custom validator for creditCards, based upon Jakarta Commons. Unless otherwise specified, all attributes accept static values or EL expressions
validateEmailA custom validator for email address format, based upons Jakarta Commons. Unless otherwise specified, all attributes accept static values or EL expressions.
validateEqualA custom validator for validations against foreign component values. Unless otherwise specified, all attributes accept static values or EL expressions.
validateRegExprA custom validator for reg. expr., based upons Jakarta Commons. Unless otherwise specified, all attributes accept static values or EL expressions.
tabChangeListenerTag to add a tab change listeners to a {@link org.apache.myfaces.custom.tabbedpane.HtmlPanelTabbedPane}
iconProviderNo Description
treeSelectionListenerTag to add a tree selection listeners to a {@link HtmlTree}
updateActionListenerRegisters an org.apache.myfaces.custom.updateactionlistener.UpdateActionListener at the parent component (which must be an ActionSource). When the parent's action fires the specified value is evaluated, then written into the specified property. Unless otherwise specified, all attributes accept static values or EL expressions. JSF 1.2 introduces a "setPropertyActionListener" with the same functionality like this.
 

Listeners
org.apache.myfaces.component.html.util.StreamingDestroyerListener
 


Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-3 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.