users@javaserverfaces.java.net

Re: prime the pump for DataTable columns?

From: Thufir <hawat.thufir_at_gmail.com>
Date: Mon, 19 Apr 2010 13:29:39 +0000 (UTC)

On Mon, 19 Apr 2010 03:03:57 +0000, Thufir wrote:

> I thought I'd figured JSF out, at least how to view data. The managed
> bean Beatles has a List<Beatle> with correct data -- at least it shows
> on the tomcat logs correctly. From experience, the trio of pages
> (template, index and table) do generate output correctly. (In this
> case, beatleTemplate.xhtml, index.xhtml and view.xhtml, for the record.)
[...]

Unfortunately, my assumption was incorrect. I forgot or didn't notice
line 9:

  var="name">

which I just changed to var="beatle" and it worked fine. User error on
my part, pardon.

what's the terminology for "var"?


> login_at_dtc01l0471-05:~$
> login_at_dtc01l0471-05:~$ nl NetBeansProjects/A00720398/web/beatles/
> index.xhtml
> 1 <?xml version='1.0' encoding='UTF-8' ?> 2 <!DOCTYPE
composition
> PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//
> EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> 3 <ui:composition xmlns:ui="http://java.sun.com/jsf/
facelets" 4
> template="./beatlesTemplate.xhtml"> 5
> 6 <ui:define name="top">
> 7 top
> 8 </ui:define>
>
> 9 <ui:define name="content">
> 10 <ui:include src="read.xhtml"/> 11 </
ui:define>
>
> 12 </ui:composition>
> login_at_dtc01l0471-05:~$
> login_at_dtc01l0471-05:~$ nl NetBeansProjects/A00720398/web/beatles/
> read.xhtml
> 1 <?xml version='1.0' encoding='UTF-8' ?> 2 <!DOCTYPE
composition
> PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//
> EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> 3 <ui:composition xmlns:ui="http://java.sun.com/jsf/
facelets" 4
> xmlns:h="http://java.sun.com/jsf/html"
5
> xmlns:f="http://java.sun.com/jsf/core" 6
> template="./beatlesTemplate.xhtml">
> 7 <ui:define name="content">
> 8 <h:dataTable value="#{beatles.list}"
> 9 var="name">
> 10 <h:column>
> 11 <h:outputText value="#{beatle.title}, "/>
12
> </h:column>
> 13 <h:column>
> 14 <h:outputText value="#{beatle.comments}"/
> 15
> </h:column>
> 16 </h:dataTable>
> 17 </ui:define>
> 18 </ui:composition>
> login_at_dtc01l0471-05:~$



thanks,

Thufir