Foros de discusión

Setting first page in alloy:paginator programmatically

Ralf Haller, modificado hace 6 años.

Setting first page in alloy:paginator programmatically

Junior Member Mensajes: 54 Fecha de incorporación: 13/05/13 Mensajes recientes
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, modificado hace 6 años.

RE: Setting first page in alloy:paginator programmatically

Liferay Master Mensajes: 760 Fecha de incorporación: 14/01/13 Mensajes recientes
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