Tuesday, August 18, 2009

JSF - panelGrid syntax

If you have a list of items and you want to display them in a grid structure (e.g. a table), here's an example of usage for the h:panelGrid for a 4-column layout:


<h:panelGrid id="your-css-id" columns="4">
<c:forEach items="${backingBean.yourListObject}" var="listItem">
<a href="/go/to/${listItem.id}">${listItem.title}</a>
</c:forEach>
</h:panelGrid>

0 comments:

Blog Archive

About Me