2011-08-16 5 views
1

私は、検索結果をダイアログに表示する検索フォームを用意しており、ユーザーが同じ検索ダイアログボックスで別の検索結果を再度検索して再表示できるようにしました。私はページ番号を持っており、ユーザーが再度検索するとページ番号がリセットされません。それは最後の検索でそれを残したページに残ります。私はPrimeface DataGridコンポーネントをバインドしてしまい、DataGrid.setPage(1)を設定し、ページネーションを修正しましたが、データは最後の行に残ります。 DataGridの行を休止する方法はありますか?私はDataGrid.setRowIndexを試しましたが、それは私のナビゲーションを削除します。何か案は?プライムフェイスのリセットDataGridの行データ

答えて

0

このバグはまだあります。私の回避策:

<p:commandButton value="#{txt['global.search']}" 
         id="search-button" 
         action="#{searchController.search}" 
         onsuccess="resetPageByNewSearch();"/> 

<script type="text/javascript"> 
function resetPageByNewSearch(data, status, xhr) { 
    var widget = PrimeFaces.widgets['dataGridWidget']; 
    if (typeof widget != "undefined") { 
     widget.getPaginator().setPage(0); 
    } 
} 
</script>