Java Reference
In-Depth Information
We need to add a <h:column> tag inside the <h:dataTable> tag for each column
we wish to add to the table. The following example illustrates typical usage of <h:
dataTable> and <h:column> .
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<f:view>
<h:form>
<h:dataTable
value=
"#{RegistrationListController.registrationBeanList}"
var="item" border="1" cellspacing="0"
cellpadding="5">
<h:column>
<f:facet name="header">
<h:outputText value="Salutation"/>
</f:facet>
<h:outputText value="#{item.salutation}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="First Name"/>
</f:facet>
<h:outputText value="#{item.firstName}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Last Name"/>
</f:facet>
<h:outputText value="#{item.lastName}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Age"/>
 
Search WWH ::




Custom Search