Dear Kaspar,

Just check in your Java code if the meta data is empty before adding the box (I 
guess, a Panel) to your page. If it is empty, add an EmptyPanel, or a 
WebMarkupContainer instead, and call ".setRenderBodyOnly(true)" on the 
EmptyPanel/WebMarkupContainer. This disables the printing of the Component's 
tag. Then, there is nothing left on your page...

Kind regards,
Bernd

-----Ursprüngliche Nachricht-----
Von: Kaspar Fischer [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 26. Februar 2008 10:47
An: [email protected]
Betreff: [Newbie question] How to avoid empty boxes?

I have just started looking at Wicket and have a basic question.

My page displays an article with meta-data from the database. I  
display the
meta-data in a box (a <div>...</div>). If no meta-information is  
present,
I don't want the box (the <div>) to appear at all. Is there a generic,
Wicket-style way for achieving this?

I struggle with two things here:

* How to do the conditional markup? (For instance, if the article has no
   author meta-information, I don't want to show "Authors: " in the  
box.)
* How to avoid empty boxes? (The box component would have to buffer its
   markup and check, in the end, whether it is nothing but whitespace.)

Thanks for any pointers.
Kaspar

---------------------------------------------------------------------
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]

Reply via email to