JSF HTML tag library.


Standard Syntax:
     <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

XML Syntax:
     <anyxmlelement xmlns:h="http://java.sun.com/jsf/html" />

This tag library implements the standard JSF HTML tags.

Tag Library Information
Display NameJSF HTML tag library.
Version1.2
Short Nameh
URIhttp://java.sun.com/jsf/html
 

Tag Summary
inputHiddenRenders as an HTML input tag with its type set to "hidden". Unless otherwise specified, all attributes accept static values or EL expressions.
columnCreates a UIComponent that represents a single column of data within a parent UIData component.

This tag is commonly used as a child of the h:dataTable tag, to represent a column of data within an html table. It can be decorated with nested "header" and "footer" facets which cause the output of header and footer rows.

The non-facet child components of this column are re-rendered on each table row to generate the content of the cell. Those child components can reference the "var" attribute of the containing h:dataTable to generate appropriate output for each row.

commandButtonThis tag renders as an HTML input element.
commandLinkThis tag renders as an HTML a element.
commandScriptNo Description
dataTableThis component renders an HTML table element.

This component may have nested facets with names "header" and "footer" to specify header and footer rows.

The non-facet children of this component are expected to be h:column components which describe the columns of the table.

formRenders an HTML form element.
graphicImageRenders an HTML img element.

The value attribute specifies the url of the image to be displayed; see the documentation for attribute "url" for more details.

inputFileRenders a HTML input element.
inputSecretRenders as an HTML input tag with its type set to "password".
inputTextRenders a HTML input element.
inputTextareaRenders a HTML textarea element.
messageRenders text displaying information about the first FacesMessage that is assigned to the component referenced by the "for" attribute.
messagesRenders all or some FacesMessages depending on the "for" and "globalOnly" attributes.
  • If globalOnly = true, only global messages, that have no associated clientId, will be displayed.
  • else if there is a "for" attribute, only messages that are assigned to the component referenced by the "for" attribute are displayed.
  • else all messages are displayed.
outputFormatRenders as text, applying the child f:param values to the value attribute as a MessageFormat string. If this element has an ID or CSS style properties, the text is wrapped in a span element.
outputLabelRenders a HTML label element. In addition to the JSF specification, MyFaces allows it to directly give an output text via the "value" attribute.
outputLinkRenders a HTML a element. Child f:param elements are added to the href attribute as query parameters. Other children are rendered as the link text or image.
outputTextRenders the value of the associated UIOutput component. If this element has an ID or CSS style properties, the text is wrapped in a span element.
panelGridThis element renders as an HTML table with specified number of columns.

Children of this element are rendered as cells in the table, filling rows from left to right. Facets named "header" and "footer" are optional and specify the content of the thead and tfoot rows, respectively.

panelGroupThis element is used to group other components where the specification requires one child element. If any of the HTML or CSS attributes are set, its content is rendered within a span element.
selectBooleanCheckboxAllow the user to choose a "true" or "false" value, presented as a checkbox.

Renders as an HTML input tag with its type set to "checkbox", and its name attribute set to the id. The "checked" attribute is rendered if the value of this component is true.

selectManyCheckboxAllow the user to select zero or more items from a set of available options.

This is presented as a table with one cell per available option; each cell contains a checkbox and the option's label. The "layout" attribute determines whether the checkboxes are laid out horizontally or vertically.

The set of available options is defined by adding child f:selectItem or f:selectItems components to this component.

The value attribute must be a value-binding expression to a property of type List, Object array or primitive array. That "collection" is expected to contain objects of the same type as SelectItem.getValue() returns for the child SelectItem objects. On rendering, any child whose value is in the list will be selected initially. During the update phase, the property setter is called to replace the original collection with a completely new collection object of the appropriate type. The new collection object contains the value of each child SelectItem object that is currently selected.

selectManyListboxAllow the user to select zero or more items from a set of available options. This is presented as a listbox which allows multiple rows in the list to be selected simultaneously.

The set of available options is defined by adding child f:selectItem or f:selectItems components to this component.

The list is rendered as an HTML select element. The "multiple" attribute is set on the element and the size attribute is set to the provided value, defaulting to the number of items in the list if no value is provided. If the size is set to 1, then a "drop-down" list (aka "combo-box") is presented, though if this is the intention then a selectManyMenu should be used instead.

The value attribute must be a value-binding expression to a property of type List, Object array or primitive array. That "collection" is expected to contain objects of the same type as SelectItem.getValue() returns for the child SelectItem objects. On rendering, any child whose value is in the list will be selected initially. During the update phase, the property is set to contain a "collection" of values for those child SelectItem objects that are currently selected.

selectManyMenuAllow the user to select zero or more items from a set of available options. This is presented as a drop-down "combo-box" which allows multiple rows in the list to be selected simultaneously.

The set of available options is defined by adding child f:selectItem or f:selectItems components to this component.

Renders as an HTML select element, with the choices made up of child f:selectItem or f:selectItems elements. The multiple attribute is set and the size attribute is set to 1.

The value attribute must be a value-binding expression to a property of type List, Object array or primitive array. That "collection" is expected to contain objects of the same type as SelectItem.getValue() returns for the child SelectItem objects. On rendering, any child whose value is in the list will be selected initially. During the update phase, the property is set to contain a "collection" of values for those child SelectItem objects that are currently selected.

selectOneListboxAllow the user to choose one option from a set of options.

Rendered as a listbox with the MULTIPLE attribute set to false.

The available choices are defined via child f:selectItem or f:selectItems elements. The size of the listbox defaults to the number of available choices; if size is explicitly set to a smaller value, then scrollbars will be rendered. If size is set to 1 then a "drop-down menu" (aka "combo-box") is rendered, though if this is the intent then selectOneMenu should be used instead.

The value attribute of this component is read to determine which of the available options is initially selected; its value should match the "value" property of one of the child SelectItem objects.

On submit of the enclosing form, the value attribute's bound property is updated to contain the "value" property from the chosen SelectItem.

selectOneMenuAllow the user to choose one option from a set of options.

Renders a drop-down menu (aka "combo-box") containing a set of choices, of which only one can be chosen at a time. The available choices are defined via child f:selectItem or f:selectItems elements.

The value attribute of this component is read to determine which of the available options is initially selected; its value should match the "value" property of one of the child SelectItem objects.

On submit of the enclosing form, the value attribute's bound property is updated to contain the "value" property from the chosen SelectItem.

selectOneRadioAllow the user to choose one option from a set of options.

Renders as an HTML table element, containing an input element for each child f:selectItem or f:selectItems elements. The input elements are rendered as type radio.

The value attribute of this component is read to determine which of the available options is initially selected; its value should match the "value" property of one of the child SelectItem objects.

On submit of the enclosing form, the value attribute's bound property is updated to contain the "value" property from the chosen SelectItem.

 


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.