0
votes

I have two List<String> and I'd like to put them in one <rich:datatable>, each List<String> should be a column on the <rich:datatable>. I'm trying to do that using <a4j:repeat>, but when I execute the program, only the headers of the <rich:datatable> appear, no content is shown on the <rich:datatable> .

Look at the code:

 <rich:dataTable>

              <rich:column> 
               <f:facet name="header">URI</f:facet>
                <a4j:repeat value="#{pesquisaBean.documentUriByTitleList}" var="uri">
                 #{uri}
                 </a4j:repeat>
              </rich:column>

              <rich:column>
               <f:facet name="header">Subject</f:facet>
               <a4j:repeat value="#{pesquisaBean.subjectByTitleList}" var="sub">
                 #{sub}
                 </a4j:repeat>
              </rich:column>

   </rich:dataTable>

What's the problem?

Thank you!

1

1 Answers

0
votes

The datatable can iterate through a list on its own, the repeat doesn't belong there. You should combine the lists into one (since I am assuming there is a relation between the URI and subject) and let the table iterate through that list. (i.e. you create an object that contains a URI and a subject and put it in a list)

<rich:dataTable value="#{bean.list}" var="item">
    <rich:column> 
        <f:facet name="header">URI</f:facet>
        #{item.uri}
    </rich:column>

    <rich:column> 
        <f:facet name="header">Subject</f:facet>
        #{item.sub}
    </rich:column>
</rich:dataTable>