Property Expansions and arrays

View: New views
3 Messages — Rating Filter:   Alert me  

Property Expansions and arrays

by Klaus Kopruch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi *

on a .tml I'd like to access an array and don't know how I can write it:

...
<div>${pax.pax.name.fNameParts[0]}</div>
...

does not work (fNameParts is an array).

Does anybody know?

Thanks, Klaus

Re: Property Expansions and arrays

by Thiago H. de Paula Figueiredo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Em Thu, 05 Nov 2009 09:03:18 -0200, Klaus Kopruch  
<klaus.kopruch@...> escreveu:

> Hi

Hi!

> on a .tml I'd like to access an array and don't know how I can write it:
> ...
> <div>${pax.pax.name.fNameParts[0]}</div>
> ...

Two ways:
1) (my recommended one) Create a getFirstNamePart() method that return  
pax.pax.name.fNameParts[0] and then use ${firstNamePart} in your template.
2) Use the OGNL binding from ChenilleKit.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Property Expansions and arrays

by Klaus Kopruch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you, very helpful!

I'll take your preferred way :-)