You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Patrick Moore <pa...@buildcap.com> on 2007/04/09 02:58:46 UTC

@Parameter(cache=true) ... am I misunderstanding this?

Hi there --

I am passing to a component's parameter the result of a containing
component's method. Now I was thinking that because of "cache=true" being
the default on @Parameter that  the container's method would only be called
once ... but this does  not seem to be the case. I am having the container's
method being called multiple times during a render operation.

Is this a bug or expected behaviour?

-Pat

Re: @Parameter(cache=true) ... am I misunderstanding this?

Posted by Howard Lewis Ship <hl...@gmail.com>.
When a parameter is cached, it is cached for at most, the duration of
the component's render.  If the parameter is accessed when the
component is not rendering, or if the component is rendered multiple
times (due to an enclosing Loop), then the container component
property will be accessed multiple times.

On 4/8/07, Patrick Moore <pa...@buildcap.com> wrote:
> Hi there --
>
> I am passing to a component's parameter the result of a containing
> component's method. Now I was thinking that because of "cache=true" being
> the default on @Parameter that  the container's method would only be called
> once ... but this does  not seem to be the case. I am having the container's
> method being called multiple times during a render operation.
>
> Is this a bug or expected behaviour?
>
> -Pat
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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