> is there a way to conditionally show certain content depending on the java > portion? one example would be that i have a main page. it displays some > content and more importantly, a login box. i want to say "if they are > already logged in, dont show the login box, but instead, show some text that > says the user is logged in". everything else on the page would be different. > one way i can do that is of course to create separate pages for it, but > there will be a lot of html or code duplication. it is theoretically > possible to do so by making your class hierarchy a certain way, but it didnt > seem natural to me. also, having this technique handy will be useful in the > future.
Basically the two different strategies you have is to either set the visibility of components (or override isVisible) appropriately, or build up the hierarchy dynamically. As an example of the latter, you could have a are in your page you call top bar. When you construct the page, you decide whether to add the top bar with the login panel, or the top bar without (e.g. to show the panel that displays the logged in user's name). The templates example in Wicket examples shows something similar. Eelco ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user