Package net.sf.wicketdemo.domain

Examples of net.sf.wicketdemo.domain.Book


      private static final long serialVersionUID = 1L;
     
      @Override
      public void onClick() {
        final UUID bookId = UUID.fromString("22222222-1111-3333-4444-000000000003");
        final Book book = ServiceFactory.getBookService().findById(bookId);
        final ViewBookPage page = new ViewBookPage(book);
        setResponsePage(page);
      }
    };
    add(link);
View Full Code Here


 
 
  public ViewBookPage(final PageParameters parameters) {
    super(parameters);
   
    Book book = null;
    final UUID id = getId(parameters.getString("id"));
    if (id != null) {
      book = ServiceFactory.getBookService().findById(id);
    }
    init(book);
View Full Code Here

*/
public class SingleAuthorBookPage extends BaseWebPage {
 
  public SingleAuthorBookPage() {
   
    final Book book = new Book();
   
    final IModel bookModel = new CompoundPropertyModel(book);
    final Form form = new BookForm("bookForm", bookModel);
   
    final TextField titleField = new TextField("title");
    form.add(titleField);
    final Set<Person> authors = book.getAuthors();
    form.add(new SingleAuthorComponent("singleAuthorComponent", //
        new Model(CollectionUtils.isEmpty(authors) ? null : authors.iterator().next())));
   
    add(form);
  }
View Full Code Here

      super(id, model);
    }
   
    @Override
    public void onSubmit() {
      final Book submittedBook = (Book) getModelObject();
     
      System.out.println(submittedBook.toString());
    }
View Full Code Here

  private final Book book;
  private final List<Person> persons;
 
  public DropDownPage() {
   
    book = new Book();
    persons = personService.findAll();
   
    addAllBooksTable();
    form = new DropDownForm("dropDownForm", new CompoundPropertyModel(book));
    addFormFields();
View Full Code Here

  }
 
  private void addAllBooksTable() {
    add(new ListView("books", new BookListModel()) {
      public void populateItem(final ListItem listItem) {
        final Book book = (Book) listItem.getModelObject();
        listItem.add(new Label("listedTitle", book.getTitle()));
       
        listItem.add(new MultiLineLabel("listedAuthor", //
            book.getAuthors().size() == 0 ? "" : book.getAuthors().iterator().next()
            .getFirstName()
            + " " + book.getAuthors().iterator().next().getLastName()));
      }
    });
   
  }
View Full Code Here

      super(id, model);
    }
   
    @Override
    public void onSubmit() {
      final Book submittedBook = (Book) getModelObject();
     
      final Book copiedBook = submittedBook.valueCopy();
      bookService.saveOrUpdate(copiedBook);
    }
View Full Code Here

*/
public class MultiAuthorBookPage extends BaseWebPage {
 
  public MultiAuthorBookPage() {
   
    final Book book = new Book();
   
    final IModel bookModel = new CompoundPropertyModel(book);
    final Form form = new BookForm("bookForm", bookModel);
   
    final TextField titleField = new TextField("title");
    form.add(titleField);
    final Set<Person> authors = book.getAuthors();
    form.add(new MultiAuthorComponent("multiAuthorComponent", //
        new Model(CollectionUtils.isEmpty(authors) ? null : authors.iterator().next())));
   
    add(form);
  }
View Full Code Here

      super(id, model);
    }
   
    @Override
    public void onSubmit() {
      final Book submittedBook = (Book) getModelObject();
     
      System.out.println(submittedBook.toString());
    }
View Full Code Here

     
      @Override
      protected void populateItem(final Item<Book> item) {
        addMetadata(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())));
      }
     
      @Override
      protected void populateEmptyItem(final Item<Book> item) {
        addMetadata(item);
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.