2013-02-23 28 views

回答

3

我認爲你最好使用<f:facet name="footer">

<f:facet name="footer"> 
     <p:commandButton/> 
    </f:facet> 

但如果你真的堅持最後一排...

嘗試rowIndexVar,是這樣的:

<p:dataTable value="#{myBean.myList}" rowIndexVar="rowIndex" var="item"> 
    <p:column> 
     <p:commandButton rendered="#{(rowIndex+1) eq myBean.myList.size()}"/> 
    </p:column> 
</p:dataTable> 
+0

THXü先生。它的工作完美呈現 – Arunprasad 2013-02-24 11:59:32

+0

,而不是渲染 – user3586195 2015-11-05 15:26:03

+0

@ user3586195,固定,TX – Daniel 2015-11-05 15:29:37

2

我不知道,如果我得到了功能要求的權利,但是從我的理解,你想在表的底部添加單個的commandButton,對於您可以使用數據表標記中的以下:

<f:facet name="footer"> 
     <p:commandButton/> 
</f:facet> 
+0

我需要2顯示在P:的commandButton在P的最後一個條目:數據表 – Arunprasad 2013-02-23 15:24:44

相關問題