title: Trouble binding a rich:dataTable
body: <p>I'm having some problems with defining a binding bean for my rich:dataTable.</p>
  
  <p>The contents of the datatable are already defined in the XHTML, I just want to use the binding to read the rows back later so that the table contents can be exported into a PDF. </p>
  
  <p>In my XHTML file, I put</p>
  
  <pre><code>&lt;rich:dataTable ... binding="#{backingBean.tableBinding}"&gt;
  </code></pre>
  
  <p>Then, in my backing bean, I declare a member:</p>
  
  <pre><code>import org.richfaces.component.html.HtmlDataTable;
  class BackingBean {
     private HtmlDataTable tableBinding ;
     public BackingBean() {
        tableBinding = new HtmlDataTable() ;
     }
     // ... (incl. getters and setters for binding)
   } ;
  </code></pre>
  
  <p>However, this results in:</p>
  
  <blockquote>
    <p>java.lang.NullPointerException
     at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:809)</p>
  </blockquote>
  
  <p>when I try to load the page. Is there something I need to do with the HtmlDataTable variable besides simply constructing it? Is it even possible to use the binding attribute in the way I intend here?</p>