Developing Web 2.0 applications
with JavaServerFaces
and Dreamweaver
>> Just Became Easier
Documentation
Search
  1. Introduction
  2. Getting Started
  3. Developing Web Sites
  4. Using Components
  5. Internationalization
  6. Code View Support
  7. Design View Support
  8. Keyboard Shortcuts
  9. Tag Object Toolbars
  10. JSF Server Behaviors
  11. Property Inspectors
  12. JSF Tag Reference
JSF HTML Tag Library
  h:body
  h:button
Selected h:column
  h:commandButton
  h:commandLink
  h:dataTable
  h:form
  h:graphicImage
  h:head
  h:inputHidden
  h:inputSecret
  h:inputText
  h:inputTextarea
  h:link
  h:message
  h:messages
  h:outputFormat
  h:outputLabel
  h:outputLink
  h:outputScript
  h:outputStylesheet
  h:outputText
  h:panelGrid
  h:panelGroup
  h:selectBooleanCheckbox
  h:selectManyCheckbox
  h:selectManyListbox
  h:selectManyMenu
  h:selectOneListbox
  h:selectOneMenu
  h:selectOneRadio
If you like this documentation, please take a look at my book:

12. JSF HTML Tag Reference

Documentation > JSF > JSF Tag Reference > JSF HTML Tag Library > h:column

h:column

The column tag renders a single column of data within a data table component. A column of data can contain any number of rows depending on the length of the array or list associated with the data table. See the dataTable tag for more information.

JSF Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:h="http://java.sun.com/jsf/html">
<h:head/>
<body>
<h:dataTable value="#{itemBean.items}" var="item" border="1" cellspacing="2">
	<h:column>
		<h:outputText value="#{item}" />
	</h:column>
</h:dataTable>
</body>
</html>
This example was formatted by JSFToolbox for Dreamweaver.

Java Code

package com.mycompany;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean
@RequestScoped
public class ItemBean {

	public List<string> getItems() {
		List<string> items = new ArrayList<string>();
		items.add("Apples");
		items.add("Oranges");
		items.add("Bananas");
		return items;
	}

}

Rendered Output

Rendered h:column tag

HTML Output

<table border="1" cellspacing="2">
  <tbody>
    <tr>
      <td>Apples</td>
    </tr>
    <tr>
      <td>Oranges</td>
    </tr>
    <tr>
      <td>Bananas</td>
    </tr>
  </tbody>
</table>

Tag Attributes

binding Expression
 
The value-binding expression linking this component tag to a backing bean property.
footerClass Text
 
The footerClass attribute accepts a space-separated list of CSS style classes (or simply a style class) to be applied to the table footer if one has been defined.
headerClass Text
 
The headerClass attribute accepts a space-separated list of CSS style classes (or a single style class) to be applied to any header generated for this table.
id Text
 
The unique identifier value for this component. The value must be unique within the closest naming container.
rendered Boolean
 
A value-binding expression that evaluates to a Boolean condition indicating if this component should be rendered.
rowHeader Text
 
Flag indicating that this column is a row header column and therefore cells in this column should be rendered with "th" instead of "td" and must have the 'scope="row"' attribute.