You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Richard Hoberman <ri...@sadalbari.com> on 2008/08/16 16:11:15 UTC

[T5] Loops - implicit value?

Hi

One thing that surprises me about T5 is that I still have to declare methods
in my class for looping.  

1.  Wouldn't this be more in line with T5's commitment to painless
development to support:

<t:loop source="myCollection">
   ${current.someProperty}
</t:loop>

In the cases where it is needed (hardly ever in my experience) the "value"
attribute would still enable another property to be used.  My classes seem
to be cluttered with loop fields.

2.  Regarding the docs

[http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Loop.html]

The NavBar.java example provides a loop field "_pageName", which is not
marked as a property.  Would this field need to be cleared via pageDetach to
avoid state hanging around in the pool?

Richard Hoberman
-- 
View this message in context: http://www.nabble.com/-T5--Loops---implicit-value--tp19011764p19011764.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: [T5] Loops - implicit value?

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi,

1. This would be nice, and it works for simple properties with the var: 
prefix. It doesn't work with property expressions, though, because there 
needs to be a property in the page for it to work.

That said, I almost always need the value of a loop in my page class. 
And with @Property it's really just a single field anyway.

2. No, it doesn't need to be. UnclaimedFieldWorker takes care of that.

-Filip

On 2008-08-16 16:11, Richard Hoberman wrote:
> Hi
> 
> One thing that surprises me about T5 is that I still have to declare methods
> in my class for looping.  
> 
> 1.  Wouldn't this be more in line with T5's commitment to painless
> development to support:
> 
> <t:loop source="myCollection">
>    ${current.someProperty}
> </t:loop>
> 
> In the cases where it is needed (hardly ever in my experience) the "value"
> attribute would still enable another property to be used.  My classes seem
> to be cluttered with loop fields.
> 
> 2.  Regarding the docs
> 
> [http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Loop.html]
> 
> The NavBar.java example provides a loop field "_pageName", which is not
> marked as a property.  Would this field need to be cleared via pageDetach to
> avoid state hanging around in the pool?
> 
> Richard Hoberman

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