2 Replies Latest reply on Mar 19, 2009 1:57 PM by gallip c

    2 facelets composition datatable in 1 xhtml

    gallip c Newbie

      Hi..
      i ve a strange problem about facelets which is related to richfaces datatable..
      i hope i can find a solution..

      i ve created a facelets composition tag for our project..simple datatable component which uses richfaces datatable.


      table.xhtml

      <rich:datatable id="#{id}" value="#{value}" var="item">
      <ui:insert/>
      <rich:datascroller for="#{id}" />
      </rich:datatable>


      column.xhtml

      <rich:column>
      <f:facet name="header"><h:outputText value="#{title}"/></f:facet>
      <ui:insert/>
      </rich:column>


      and when i wrote..

      <m:table id="one" value="null">
      <m:column title="A"><h:outputText value="a"/></m:column>
      <m:column title="A"><h:outputText value="a"/></m:column>
      </m:table>
      <m:table id="two" value="null">
      <m:column title="B"><h:outputText value="b"/></m:column>
      <m:column title="B"><h:outputText value="b"/></m:column>
      </m:table>

      my facelets renders

      1 table with 4 columns and 2 rows
      something like

      A A B B
      a a b b

      but i need 2 datatable in my xhtml.so weird..

      please help

      thanks in advance..

        • 1. Re: 2 facelets composition datatable in 1 xhtml
          Ilya Shaikovsky Master

          just tried.

          page code

           <h:form id="myform">
           <tb:table id="table" value="#{capitalsBean.capitals}">
           <tb:column title="Name">
           <h:outputText value="#{item.name}" />
           </tb:column>
           </tb:table>
           <tb:table id="table2" value="#{capitalsBean.capitals}">
           <tb:column title="Name">
           <h:outputText value="#{item.name}" />
           </tb:column>
           </tb:table>
           </h:form>
          


          table facelet
          <ui:composition>
           <rich:dataTable id="#{id}" value="#{capitalsBean.capitals}" var="item">
           <ui:insert />
           </rich:dataTable>
           <rich:datascroller for="#{id}" />
          </ui:composition>
          


          column facelet
          <ui:composition>
           <rich:column>
           <f:facet name="header">
           <h:outputText value="#{title}" />
           </f:facet>
           <ui:insert />
           </rich:column>
          </ui:composition>
          


          works just as it should. two tables rendered.

          • 2. Re: 2 facelets composition datatable in 1 xhtml
            gallip c Newbie

            i realized that i had forgotten to remove binding attribute from my table composition. =)) ex: binding={binding} wtf ? :)

            thanks ilya for testing..i needed someone to test and say its ok.