I need to render the <p:commandButton>
at last entry of the <p:datatable>
only .
consider if p:datatable
having n no.of rows means i have render the p:commandButton
at nth row only.
Asked
Active
Viewed 3,244 times
1

Arunprasad
- 567
- 4
- 14
- 29
2 Answers
4
I think that you better use <f:facet name="footer">
<f:facet name="footer">
<p:commandButton/>
</f:facet>
But if you really insist on last row...
Try the rowIndexVar
, something like this :
<p:dataTable value="#{myBean.myList}" rowIndexVar="rowIndex" var="item">
<p:column>
<p:commandButton rendered="#{(rowIndex+1) eq myBean.myList.size()}"/>
</p:column>
</p:dataTable>

Daniel
- 36,833
- 10
- 119
- 200
-
rendered instead of render – user3586195 Nov 05 '15 at 15:26
-
@user3586195 , fixed, tx – Daniel Nov 05 '15 at 15:29
2
I don't know if I got the functional requirement right, but from what I understand you want to add a single commandButton at the bottom of the table, for that you might use the following inside datatable tags:
<f:facet name="footer">
<p:commandButton/>
</f:facet>

Can Yegane
- 514
- 4
- 11