Hi all,

In my project, i would like to change the link for an image in different pages, where the image is in the header (which is in the base class of pages).
The code snippet i tried:

//This is my base class for the other pages
public class PageTemplate extends WebPage {

...
//The base class constructor
public PageTemplate(){
WebMarkupContainer headerLabelContainer = new WebMarkupContainer("headerLabelContainer");
       add(headerLabelContainer);
//I have to set a default value, so it would be declared for wicket, so when i have a page, which i don't want to contain this imagelink, there won't be a problem headerLabelContainer.add(new BookmarkablePageLink("detailView", ShowUser.class)).setVisible(false);
                                   }
...

public void setHeaderDetailViewLink(Class pageClass, String param) {
       get("headerLabelContainer").setVisible(true);
//this part is what won't work:
((WebMarkupContainer) get("headerLabelContainer")).get("detailView").setModel(new Model(UserHistory.class)); // i tried also new bookmarkablepagelink(...), but the problem is the same, the link is pointing to the pre-declared page...
...
}

The HTML code is:

<div class="header" wicket:id="headerLabelContainer">
<a wicket:id="detailView" class="btn"><img src="images/btnDetailView.gif" alt="Részletes nézet" /></a>
               </div>

So the simple question would be: how to change the bookmarkablepagelink model? The header also has a Label, which changes by pages, with the setModel(new Model("new text")); command...
I can't figure out what the problem is.

Regards,
Peter Major

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to