On Wed, 12 May 2010 07:09:18 -0300, Claude Dubois <cduboi...@gmail.com>
wrote:
Is it possible to use this syntax in other cases? For example adding a
"else"?
No. Create a getXXX() method in your corresponding class and do this logic
there. Tapestry's philosophy is to not have logic in templates.
I tried to add ":" like this :
${user.shop?.shoCode:"No Data"}
and it doesn't work.
${shopCode}
public void getShopCode() {
if (getUser().getShop() != null) {
return getUser().getShop().getShopCode();
}
else {
return "No Data";
}
}
Another option is to use the OGNL binding from ChenilleKit, but I
recommend the approach above.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org