Why is my PageableListView & PagingNavigation function not working?

I am trying to use PageableListView with PagingNavigation. From examples that look pretty easy, but I can't get it to work. I always get the following error message:

The component below failed to render. A common problem is that you added the component to the code, but forgot to reference it in the markup

Here is my Java code:

class FriendsPanel extends Panel {
public FriendsPanel(String id){
    super(id);

    List<User> friends = ...;

        PageableListView<User> listview = new PageableListView<User>("listview", friends, 10) {
            protected void populateItem(ListItem<User> item) {
                User user = item.getModel().getObject();
                item.add(new Label("label", user.getName()));
            }
        };

        add(listview);
        add(new PagingNavigation("navigator", listview));
    }
}
}

My html looks like this:

<html xmlns:wicket>
  <wicket:panel>
    <br />
    <span wicket:id="listview">
        <span wicket:id="label">label</span><br>
    </span>
    <div wicket:id="navigator"></div>
  </wicket:panel>
</html>

Any ideas how to make this work?

+3
source share
1 answer

PagingNavigation . , "pageLink" "pageNumber". Javadoc , .

PagingNavigator , ( , PagingNavigation). , , .

+8

Source: https://habr.com/ru/post/1762278/


All Articles