webtier@glassfish.java.net

can't make <h:dataGrid> render body data!

From: <webtier_at_javadesktop.org>
Date: Wed, 28 Jul 2010 11:56:02 PDT

Hi guys,

I am having a very strange issue with a web app we are building in JSF 2.0. We have built a number of screens successfully with little issue with the JSF 2.0 framework.

HOWEVER, when attempting to implement an <h:dataGrid> control we have only been able to get the column header and footer values (using facets) to render and all data even if hardcoded within the main body of the table will not show.

When viewing the rendered html source from the browser, it is discovered that where the dataGrid body data should be there is only the following:

<tbody><tr><td></td></tr></tbody> set of tags.

We have tried adding data by using a bean, through outputText tags and just plain old hardcoding.

I figure there must be something wrong with my environment but not sure. I have searched a lot on the forums with little success of someone having a similar issue.

Perhaps I am missing something glaringly obvious to the rest of you?

Here is a simple xhtml page I have put together using a dataGrid that does NOT work for me in my environment:

=================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      contentType="text/html">

<html>
<h:head>

        
        <title>Our website</title>
        

</h:head>

<h:body>

<h:form>
        
        <h:dataTable border="1" cellpadding="2" width="50%">
                <h:column>
                        <f:facet name="header">
                                <h:outputText value="Name"/>
                        </f:facet>
                        <h:outputText value="Chris"/>
                </h:column>
                <h:column>
                        <f:facet name="header">
                                <h:outputText value="City"/>
                        </f:facet>
                        <h:outputText value="Toronto"/>
                </h:column>
                
        </h:dataTable>
        
</h:form>
</h:body>
</html>
</f:view>
========================================

Does anyone see anything wrong with this? Any help is appreciated please as it is now holding up getting back to the business of building the app.

Thanks in advance!

Cheers
[Message sent by forum member 'cgruther51']

http://forums.java.net/jive/thread.jspa?messageID=478734