Use an dinamic model, ex:

Label currentPage = new Label("currentPage", new
AbstractReadOnlyModel<String>() {
            public String getObject() {
                return pagination.getPageable().getCurrentPage();
            }
        });

On Tue, Nov 9, 2010 at 2:04 PM, Vishal Popat <vishal.po...@cipriati.co.uk>wrote:

> Hi all,
>
> For some reason I cannot get the current page number. This is the relevant
> part of my code:
>
>
>
> PageableListView dataList = new PageableListView("dataList", results, 10) {
>
>            protected void populateItem(ListItem item) {
>
>                        ..
>
> }
>
>            }
>
>
>
>        AjaxPagingNavigator pagination = new
> AjaxPagingNavigator("navigator", dataList);
>
>        add(pagination);
>
>
>
>        Label currentPage = new Label("currentPage",
> pagination.getPageable().getCurrentPage() + "");
>
>        currentPage.setOutputMarkupId(true);
>
>        add(currentPage);
>
>
>
> currentPage always returns 0.
>
> I have also tried PagingNavigator with similar results.
>
>
>
> Can anyone tell me what I have missed?
>
>
>
> Regards
>
>
>
> Vishal
>
>


-- 
Pedro Henrique Oliveira dos Santos

Reply via email to