if (condition) add component is static - if you put it into constructor it is only evaluated once, so if login status changes in the middle of the lifecyle of the panel it will not reflect the change.
personally something like add(new loggedinpanel(..) { isvisible() { return isuserloggedin(); } }); add(new notloggedinpanel(..) { isvisible() { return !isuserloggedin(); }}); works much better if these panels contain a lot of components, or components that are expensive to construct, you can add the appropriate one in obeforerender onbeforerender() { if (loggedin()) { if (get("panel")==null) add(new loggedinpanel("panel"); else if (!get("panel") instanceof loggedinpanel) { get("panel").replacewith(new loggedinpanel("panel"); } } else { if (get("panel")==null) add(new loggedoutpanel("panel"); else if (!get("panel") instanceof loggedoutpanel) { get("panel").replacewith(new loggedoutpanel("panel"); } } -igor if (isuserloggedin()) { add(new loggedinpanel On Thu, Mar 13, 2008 at 11:25 AM, Mathias P.W Nilsson <[EMAIL PROTECTED]> wrote: > > Ehh.... looks complicated. What about the old if( condition ) add Component ? > -- > View this message in context: > http://www.nabble.com/Different-content-for-user-tp16027844p16034721.html > > > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]