Example usage for org.apache.wicket.markup.html.list ListView setViewSize

List of usage examples for org.apache.wicket.markup.html.list ListView setViewSize

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.list ListView setViewSize.

Prototype

public ListView<T> setViewSize(final int size) 

Source Link

Document

Define the maximum number of items to render.

Usage

From source file:fiftyfive.wicket.css.IterationCssBehaviorTestPage.java

License:Apache License

public IterationCssBehaviorTestPage() {
    List<String> list = Arrays.asList("1", "2", "3", "4", "5", "6");
    ListView<String> listView = new ListView<String>("listView", list) {
        @Override/*w  w w .  ja  va2  s. c  o m*/
        protected void populateItem(ListItem<String> it) {
            it.add(new IterationCssBehavior("odd", "even", "first", "last", "iteration"));
        }
    };
    listView.setViewSize(5);
    add(listView);

    DataView<String> dataView = new DataView<String>("dataView", new ListDataProvider<String>(list)) {
        @Override
        protected void populateItem(Item<String> it) {
            it.add(new IterationCssBehavior("odd", "even", "first", "last", "iteration"));
        }
    };
    dataView.setItemsPerPage(5);
    add(dataView);

    add(newLoop("loop0", 0));
    add(newLoop("loop1", 1));
    add(newLoop("loop2", 2));
}