Wicket 3.2

Wicket In Action

Now a list of cheeses and a shopping cart is put into Index.html.

The imports show the components that will be added as behaviors to the Index.java in this section:

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.list.PageableListView;
import org.apache.wicket.markup.html.navigation.paging.PagingNavigator;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;

… … … … … … . section_3_2
… … … … … … … Checkout.html
… … … … … … … Checkout.java
… … … … … … … Index.html
… … … … … … … Index.java
… … … … … … … . logo.png
… … … … … … … style.css

Checkout.java is an empty class that is implemented in the next section.

Notice the <wicket:remove> block in Index.html. 
This is simply markup that is there for previewing purposes only. 
When the page renders, the <wicket:remove> block is stripped out.
The listing below is a partial listing of Index.html, without shopping cart and checkout button.

A ListView is rendered using the id "cheeses":

3_2_1.jpg
3_2_2.jpg
3_2_3.jpg
3_2_4.jpg
3_2_5.jpg
3_2_6.jpg

Note the use of PageableListView in Index.java

wicket_3_2_1.jpg
wicket_3_2_2.jpg

When the cart has been added to Index.html, then you can click "Add to Cart" as shown below. The Checkout button becomes visible when the cart has an entry.

wicket_3_3_1.jpg3_2_7.jpg
3_2_8.jpg
3_2_9.jpg
3_2_10.jpg
3_2_11.jpg
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License