0

いくつかのドキュメントをリストする繰り返しコントロールを作成しました。エントリ数が繰り返しコントロールで指定されたエントリの最大数を超えた場合にのみ表示されるページが必要です。

繰り返しコントロールに現在表示されているエントリの数を確認することはできますか? または、これを行うための最良の方法は何ですか?

4

2 に答える 2

2

役立つ SSJS を次に示します。

var r:com.ibm.xsp.component.UIRepeat = getComponent("repeat1"); 
var count = r.getRowCount() // returns all entries
var pos = r.getFirst(); // returns current position of first entry
var rows = r.getRows(); // get rows of repeat controls

var curPage = pos / rows + 1;
var pagesTotal = ( count - (count % rows)) / rows + 1;

編集:

現在表示されているエントリの数を計算するには、次のようにします。

if( curPage == pagesTotal ){
   return (count % rows)
}else{
   return rows;
}
于 2012-06-12T16:11:06.440 に答える
1

これは役に立ちますか?http://www.mydominolab.com/2010/10/repeat-control-better-navigation.html

簡単に比較できると思いますgetRowCount() > getRows()

于 2012-06-13T11:49:13.247 に答える