> Both Login and CurrentProfile are subclasses of "Panel". When the > login form is submitted or the logout link is submitted, in order to > get the page to re-render, I had to use this code: > > setResponsePage(getPage().getClass());
In this case the page isn't re-rendered, it is re-created, i.e. a new instance of your page class is instantiated, which then does the add(new CurrentProfile()) in its constructor. In the default behavior you're getting the exact same page instance you initially created and in which you said add(new Login()). To replace the login panel with the profile panel, keep a reference to the login panel and in your form submit method do this: login.replaceWith(new CurrentProfile()) This removes the login panel from the page and, as the method name suggests, replaces it with the CurrentProfile instance. Remember the latter in a field too, if you ever want to switch back. This way you only have one page and swap out its components instead of creating new page instances. Hope this helps Carl-Eric --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
