2011-03-09 21 views
3

我有一個關於我需要添加到dataTable/dataScroller組件的函數的問題。重新渲染dataTable/dataScroller並返回結果的第一頁分頁

我有以下代碼:

<a4j:outputPanel id="renderArea"> 
    <rich:dataTable id="mainDataTable"> 
     ...... 
     <rich:column> 
      <h:commandButton value="Add" action="#{myBean.addItem}" reRender="myDataScroller, mainDataTable"/> 
     </rich:column> 
    </rich:dataTable> 
</a4j:outputPanel> 


<a4j:outputPanel id="PTScroll"> 
    <h:panelGrid> 
     <rich:datascroller for="mainDataTable" id="myDataScroller" maxPages="20" renderIfSinglePage="false" /> 
    </h:panelGrid> 
</a4j:outputPanel> 

因此,當用戶在第二/第三次/等分頁表中的頁上,並且它們通過作用=「#{添加項目myBean.addItem }「行動。我想dataTable/dataScroller reRender並返回到我的表的第一頁。

有沒有在我的jsf代碼中做到這一點的簡單方法?

感謝

+0

回答這個問題,這也恰好是一個「頁面無法復位的」 **解決方法RichFaces的問題是在這裏:https://community.jboss.org/message/616893#616893** – acdcjunior 2014-01-29 13:58:17

回答

1

rich:datascroller具有頁面屬性,它應該工作。

如果頁面> = 1,那麼這是一個頁碼顯示

相關問題