Package net.sf.wicketdemo.domain

Examples of net.sf.wicketdemo.domain.Book


        };
      }
     
      @Override
      protected void populateItem(final Item<Book> item) {
        final Book book = item.getModelObject();
        item.add(new Label("title", book.getTitle()));
        item.add(new Label("isbn", book.getISBN()));
        item.add(new Label("price", ObjectUtils.toString(book.getPrice())));
      }
    };
    add(rv);
  }
View Full Code Here


        "demoPageableListView", ServiceFactory.getBookService().findAll(), 4) {
      private static final long serialVersionUID = 1L;
     
      @Override
      protected void populateItem(final ListItem<Book> item) {
        final Book book = item.getModelObject();
        item.add(new Label("title", book.getTitle()));
        item.add(new Label("isbn", book.getISBN()));
        item.add(new Label("price", ObjectUtils.toString(book.getPrice())));
      }
    };
    add(lv);
   
    add(new Label("currentPage", new PropertyModel<String>(lv, "currentPage")));
View Full Code Here

        "demoPageableListViewWithAjaxNavigation", ServiceFactory.getBookService().findAll(), 4) {
      private static final long serialVersionUID = 1L;
     
      @Override
      protected void populateItem(final ListItem<Book> item) {
        final Book book = item.getModelObject();
        item.add(new Label("title", book.getTitle()));
        item.add(new Label("isbn", book.getISBN()));
        item.add(new Label("price", ObjectUtils.toString(book.getPrice())));
      }
    };
    c.add(lv);
    // Following is not meant to be used "as such", but is used in conjunction with AjaxPagingNavigator.
    // c.add(new AjaxPagingNavigation("navigationAjaxified", lv));
View Full Code Here

    final DataView<Book> rv = new DataView<Book>("demoDataView", dataProvider, ITEMS_PER_PAGE) {
      private static final long serialVersionUID = 1L;
     
      @Override
      protected void populateItem(final Item<Book> item) {
        final Book book = item.getModelObject();
        item.add(new Label("title", book.getTitle()));
        item.add(new Label("isbn", book.getISBN()));
        item.add(new Label("price", ObjectUtils.toString(book.getPrice())));
      }
    };
    c.add(rv);
   
    c.add(new AjaxPagingNavigator("navigator", rv));
View Full Code Here

    final ListView<Book> lv = new ListView<Book>("demoListView", getSomeBooks()) {
      private static final long serialVersionUID = 1L;
     
      @Override
      protected void populateItem(final ListItem<Book> item) {
        final Book book = item.getModelObject();
        item.add(new Label("title", book.getTitle()));
        item.add(new Label("isbn", book.getISBN()));
        item.add(new Label("price", ObjectUtils.toString(book.getPrice())));
      }
     
      /**
       * Note: Override this method and provide a model that stores the object identifier
       * instead of the index in the list if you plan to perform CRUD-operations on the items
       * in the list.
       */
      @Override
      protected IModel<Book> getListItemModel(//
          final IModel<? extends List<Book>> listViewModel, final int index) {
        final Book book = listViewModel.getObject().get(index);
        // This model serializes the complete book object
        //return Model.of(book);
        // OR
        // This model serializes the identifier of the book object,
        // and searches the book in the list through its identifier.
        return new IdentifyingListItemModel<Book, UUID>(this, book.getId());
      }
    };
    add(lv);
  }
View Full Code Here

TOP

Related Classes of net.sf.wicketdemo.domain.Book

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.