留言板

Setting first page in alloy:paginator programmatically

Ralf Haller,修改在6 年前。

Setting first page in alloy:paginator programmatically

Junior Member 帖子: 54 加入日期: 13-5-13 最近的帖子
Hi community,

I would like to know if it is possible to set alloy:paginator to its first page programmatically e.g. using Javascript or AJAX events in Liferay 6.2.

Thanks for any help,

Ralf
thumbnail
Kyle Joseph Stiemann,修改在6 年前。

RE: Setting first page in alloy:paginator programmatically

Liferay Master 帖子: 760 加入日期: 13-1-14 最近的帖子
Hi Ralf,
You can use alloy:dataTable's first attribute to set the first row that should be displayed (the row numbers are zero-relative). For example if your alloy:paginator has 10 rows per page and you want to display page 2 initially, you could set first="10". In order to change the value programmatically, you can either bind the value to a bean value (for example first="#{bean.firstRow}") and change the bean value (I recommend this way), or you can obtain the DataTable component and call setFirst(). Either way the paginator will automatically determine the current page and display the appropriate markup.

- Kyle