how do you go back to that page?
but saying: setResponsePage(new MyPage());

then you will have a new instance of mypage with the link instead of label.
if you are having MyPage1 and MyPage2 (where you go to from mypage1 that has the link replaced)
and if you want to go to the same instance then you have to give the mypage1 instance to mypage2 instance
and on every link you have there where you do setResponsePage to youre first page you use that instance, so you don't make a new one.

johan



Norbert Sándor wrote:
Hi,

I'd like to create 2 pages. They have a shared border with links to both pages.
One of the pages has a Link which is replaced with a Label when the link is clicked.
What should I do with the page to "remember" that the link was replaced with the label? Now it changes back to link when the next time I visit the page using the border.
The related source codes:

Border.html

<wicket:link>
     <a href="">home</a>
     <a href="">another</a>
</wicket:link>
HomePage.java

public class HomePage extends NormalPage
{
    public HomePage()
    {
        getBorder().add(new Label("label", "home"));
    }
}
ProductsPage.java

public class AnotherPage extends NormalPage
{
    public AnotherPage()
    {
        getBorder().add(new Link("label")
        {
            public void onClick()
            {
                this.getParent().replace(new Label("label", "simple label"));
            }
        });
    }
}
 
 
Thanks in advance!
Norbi

Reply via email to