Search code examples
jsfprimefaces-extensions

Using dataTable with Primefaces DynaForms


I've been trying to use dataTable with dynaforms, with no success; I get no results. I've been able to generate results with dataList, though. Can someone please explain what I need to correct? I have used both p:dataTable and h:dataTable. I surrounded the dataList reference with comments so you can see what I did.

<h:form id="frm">
   <p:panel >
      <h:panelGroup>
         <!--<p:dataList value="#{dynalogBean.cannedList}" var="allValues">-->
         <p:dataTable value="#{dynalogBean.cannedList}" var="allValues">
             <pe:dynaForm value="#{allValues}" var="data">
                 <pe:dynaFormControl>
                     <p:outputLabel value = "#{data}" />
                 </pe:dynaFormControl>

                 <pe:dynaFormControl type="CT" for="vals">
                     <h:outputText id="vals" value = "#{data.value}" />
                 </pe:dynaFormControl>
             </pe:dynaForm>  
          </p:dataTable>  
          <!--</p:dataList> -->
       </h:panelGroup>
   </p:panel >
</h:form >

Solution

  • The p:datatable render time does not support any other tags as effective children than

    • f:facet
    • p:ajax
    • p:column
    • p:columns

    Composites work as long as they contain one of these four tags.

    So if you put your pe:dynaForm inside a p:column tag, it works.