1 2 Previous Next 17 Replies Latest reply on Apr 8, 2010 2:24 PM by John Bailo

    Richfaces datatable will not call bean or render data

    John Bailo Master

      I developed a java bean that will produce a List of users from an ldap server.

       

      I am able to display the data in a jsf table if I use the html library for jsf.   However, when I switch to using richfaces, it doesn't seem to fire up the .users method on the same bean and no data is rendered.   In both cases the page renders without error, but in the second, there is no data in the data grid.

       

      This version works:

       

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

       

      <h:dataTable value="#{userBean2.users}" var="user"
                  bgcolor="#F1F1F1" border="10" cellpadding="5"
                  cellspacing="3" first="0"  width="50%"
                  dir="LTR" frame="hsides" rules="all"
                  summary="This is a JSF code to create dataTable." >
              <h:column>
                   <h:outputText id="name" value="#{user.name}"/>
              </h:column>
              <h:column>
                   <h:outputText id="email" value="#{user.email}"/>
              </h:column>
         </h:dataTable>

       

       

      This version does not work:

       

      <!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:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">



         <rich:dataTable value="#{userBean.users}" var="user">
          <h:column>
           <h:outputText id="name" value="#{user.name}"/>
          </h:column>
          <h:column>
           <h:outputText id="email" value="#{user.email}"/>
          </h:column>
         </rich:dataTable>


        1 2 Previous Next