jsf - ui: repeat + p: datatable question -
i displaying multiple p:datatable
's through ui:repeat
, following code snippet illustrates doing:
<ui:repeat id="searchtables" value="#{searchbean.mapkeys}" var="mapkeys"> <p:datatable id="recordtable" value="#{searchbean.resultmap[mapkeys].resultlist}" var="recordtable" paginator="true" rows="10"> <f:facet name="header"> <h:outputtext value="#{searchbean.resultmap[mapkeys].name}"/> </f:facet> <p:columns value="#{searchbean.resultmap[mapkeys].resultcolumns}" var="column" columnindexvar="colindex"> <f:facet name="header"> <p:outputpanel> #{column.header} </p:outputpanel> </f:facet> <h:outputtext value="#{recordtable[column.property]}"/><br/> </p:columns> </p:datatable> </ui:repeat>
i need each individual datatable have own paginator, when page displayed first datatable gets paginator , paginator controls other displayed datatables pages..
thanks attention!
the way found use 2 p:datatable tags, parent 1 1 column. couldn't make work p:datalist. guess p:datalist extending same bogus class.
should work this:
<p:datatable id="searchtables" value="#{searchbean.mapkeys}" var="mapkeys"> <p:column> <p:datatable id="recordtable" value="#{searchbean.resultmap[mapkeys].resultlist}" var="recordtable" paginator="true" rows="10"> <f:facet name="header"> <h:outputtext value="#{searchbean.resultmap[mapkeys].name}"/> </f:facet> <p:columns value="#{searchbean.resultmap[mapkeys].resultcolumns}" var="column" columnindexvar="colindex"> <f:facet name="header"> <p:outputpanel> #{column.header} </p:outputpanel> </f:facet> <h:outputtext value="#{recordtable[column.property]}"/><br/> </p:columns> </p:datatable> </p:column> </p:datatable>
Comments
Post a Comment