* Constructor
*/
public TemplatePage()
{
add(new Label("title", new PropertyModel<String>(this, "pageTitle")));
add(currentBanner = new Banner1("ad"));
add(new Link("changeAdLink")
{
/**
* @see org.apache.wicket.markup.html.link.Link#onClick()
*/
@Override
public void onClick()
{
if (currentBanner.getClass() == Banner1.class)
{
TemplatePage.this.replace(currentBanner = new Banner2("ad"));
}
else
{
TemplatePage.this.replace(currentBanner = new Banner1("ad"));
}
}
});
add(new BookmarkablePageLink<Void>("page1Link", Page1.class));
add(new BookmarkablePageLink<Void>("page2Link", Page2.class));