Thanks Janos! This will solve the problem! Although it has extra unused tag in the markup.
Regards, Wen Tong -- The only constant in life is change. ----- Original Message ---- From: Janos Cserep <[EMAIL PROTECTED]> To: [email protected] Sent: Monday, February 4, 2008 12:40:16 PM Subject: Re: adding conditional component > > How do you guys implement a link that is conditional? Like for example the > link only shows if a given data is provided. Adding the <a>-tag in the > Markup will coz an error if the condition is not met, because AjaxLink is > not added. > > I usually handle such a situation by overriding the isVisible() method of the component: add(new Link("link") { @Override public boolean isVisible() { boolean externalCondition = ....; return super.isVisible() && externalCondition; } }); ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
