You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Marcus Schmidke <Ma...@Schmidke.de> on 2007/09/08 11:40:21 UTC

T5: @Parameter writes into the field without using the setter method?

Hello,

I've written a component which has a parameter field marked as
"@Parameter". This works fine, but if I try to do some other work in
the setter method for this parameter, I can see that it isn't called.

Trying to put @Parameter annotation on the method fails because it's a
field annotation.

Shouldn't, if present, the setter be used instead of directly writing
into the field?

Marcus.

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


Re: T5: @Parameter writes into the field without using the setter method?

Posted by Howard Lewis Ship <hl...@gmail.com>.
That's not how parameters work.  The access to the field, both read and
write, is "enhanced" by Tapestry.  Updating the field fires off some
behavior to push the new value, through
the binding object, into the bound property of the component's container.

Likewise, reading a parameter field will fire off the behavior related to
reading the property value via the binding.  There's also a lot going on in
terms of caching the value (while rendering, or if the binding is invariant)
and clearing the value out at the end of the request (to get rid of dangling
references, etc.).

On 9/8/07, Marcus Schmidke <Ma...@schmidke.de> wrote:
>
> Hello,
>
> I've written a component which has a parameter field marked as
> "@Parameter". This works fine, but if I try to do some other work in
> the setter method for this parameter, I can see that it isn't called.
>
> Trying to put @Parameter annotation on the method fails because it's a
> field annotation.
>
> Shouldn't, if present, the setter be used instead of directly writing
> into the field?
>
> Marcus.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
Partner and Senior Architect at Feature50

Creator Apache Tapestry and Apache HiveMind