Hi, I too miss ognl, but your point is very good. At first this new way seems limited, but I agree that testability makes for it. (And one could argue that you dont have to learn yet another language to implement your logic.) Also, refactoring is a bit easier again. Thanks, - Ville
> Date: Fri, 11 Jan 2008 11:26:34 -0200> To: users@tapestry.apache.org> > Subject: Re: T5 : if component help> From: [EMAIL PROTECTED]> > On Fri, 11 > Jan 2008 04:33:43 -0200, Ville Virtanen > <[EMAIL PROTECTED]> wrote:> > > Hi > all,> > I need to test if a property in my page equals a value from static > > > constant class. I have no clue if this can be done. I mean something > > > like:<t:if > > test="selectedSubMenu.equals(@[EMAIL PROTECTED])">> > I'm > currently learning to do things after T4. (Hence the ognl in equals > > > clause, which im not sure is even relevant to T5, is it still using ognl > > > under the hood?)> > T5, by default, does not use OGNL. It uses something very > similar to the > prop binding in T4. So move your logic to a method that > returns a boolean > value and use this in your template:> > public boolean > isObjectsMenu() {> return > > selectedSubMenu.equals(com.example.something.admin.SubMenuConstants.OBJECTS);> > }> > <t:if test="objectsMenu">> > Coming from T4, at first I missed the > power of OGNL, but then I realized > that moving all logic to the page class > makes it more easily testable and > debuggable. ;)> > -- > Thiago H. de Paula > Figueiredo> Desenvolvedor, Instrutor e Consultor de Tecnologia> Eteg > Tecnologia da Informação Ltda.> http://www.eteg.com.br> > > ---------------------------------------------------------------------> To > unsubscribe, e-mail: [EMAIL PROTECTED]> For additional commands, e-mail: > [EMAIL PROTECTED]> _________________________________________________________________ Windows Vista + Windows Live. Astu digitaaliseen maailmaan. http://get.live.com