You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alex Kartashev <al...@gmail.com> on 2006/03/01 17:43:26 UTC
Component Parameters and Properties
Hi guys,
I am a new Tapestry 4 user. I've been researching Tapestry 4 for about a
week now, even developed some toy apps. I am already sold on the value
proposition.
One thing I am a bit confused about is Component parameters and properties.
1. Is there any difference between a component parameter and property?
Or are these words used interchangeably?
2. Whereas lifecycle of page properties is very clear: pages are pooled
and their properties are cleared out upon returning to the pool,
components are not pooled independently but along with their pages. So,
what about they properties/parameters? Will they be cleared out
automatically as well?
Thank a lot in advance,
Alex
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Component Parameters and Properties
Posted by Geoff Longman <gl...@gmail.com>.
parameters are like java method parameters
properties are like java instance variables.
How you configure them what Tapestry does with them is the magic.
geoff
On 3/1/06, Alex Kartashev <al...@gmail.com> wrote:
> Hi guys,
>
> I am a new Tapestry 4 user. I've been researching Tapestry 4 for about a
> week now, even developed some toy apps. I am already sold on the value
> proposition.
>
> One thing I am a bit confused about is Component parameters and properties.
>
> 1. Is there any difference between a component parameter and property?
> Or are these words used interchangeably?
>
> 2. Whereas lifecycle of page properties is very clear: pages are pooled
> and their properties are cleared out upon returning to the pool,
> components are not pooled independently but along with their pages. So,
> what about they properties/parameters? Will they be cleared out
> automatically as well?
>
>
> Thank a lot in advance,
>
> Alex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
--
The Spindle guy. http://spindle.sf.net
Get help with Spindle:
http://lists.sourceforge.net/mailman/listinfo/spindle-user
Blog: http://jroller.com/page/glongman
Feature Updates: http://spindle.sf.net/updates
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Component Parameters and Properties
Posted by Alex Kartashev <al...@gmail.com>.
Got it. Thank you very much!
Alex
Ron Piterman wrote:
> AFAIK, tapestry properties will be reset, unless you specify them
> persist.
> If you want to reset also instance variables you use during the
> request you should use the pageDetachListener interface (just
> implement it, no need to addListener anywhere, tapestry will do that
> for you).
> Cheers,
> Ron
>
> Alex Kartashev wrote:
>
>> Very nice analogy on Unix symlink! I think I understand now the
>> concept of a component parameter (the Users Guide is an invaluable
>> resource there, I must say).
>>
>> What about the lifecyle of a component property? All I want to make
>> sure is that they will be reset once the containing page goes back to
>> the pool.
>>
>> Thanks,
>>
>> Alex
>>
>>
>>
>> Ron Piterman wrote:
>>
>>> just another thing : parameters function very much like symlinks in
>>> linux/unix -
>>> when you read them you actually read the target of the link, and
>>> when you write to them you change the target of the link -
>>> The important thing is where the link is pointing to -
>>> this you decide in the <binding element.
>>> Cheers,
>>> Ron
>>>
>>>
>>> Alex Kartashev wrote:
>>>
>>>> Hi guys,
>>>>
>>>> I am a new Tapestry 4 user. I've been researching Tapestry 4 for
>>>> about a week now, even developed some toy apps. I am already sold
>>>> on the value proposition.
>>>>
>>>> One thing I am a bit confused about is Component parameters and
>>>> properties.
>>>>
>>>> 1. Is there any difference between a component parameter and
>>>> property? Or are these words used interchangeably?
>>>>
>>>> 2. Whereas lifecycle of page properties is very clear: pages are
>>>> pooled and their properties are cleared out upon returning to the
>>>> pool, components are not pooled independently but along with their
>>>> pages. So, what about they properties/parameters? Will they be
>>>> cleared out automatically as well?
>>>>
>>>>
>>>> Thank a lot in advance,
>>>>
>>>> Alex
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Component Parameters and Properties
Posted by Ron Piterman <rp...@gmx.net>.
AFAIK, tapestry properties will be reset, unless you specify them persist.
If you want to reset also instance variables you use during the request
you should use the pageDetachListener interface (just implement it, no
need to addListener anywhere, tapestry will do that for you).
Cheers,
Ron
Alex Kartashev wrote:
> Very nice analogy on Unix symlink! I think I understand now the concept
> of a component parameter (the Users Guide is an invaluable resource
> there, I must say).
>
> What about the lifecyle of a component property? All I want to make sure
> is that they will be reset once the containing page goes back to the pool.
>
> Thanks,
>
> Alex
>
>
>
> Ron Piterman wrote:
>
>> just another thing : parameters function very much like symlinks in
>> linux/unix -
>> when you read them you actually read the target of the link, and when
>> you write to them you change the target of the link -
>> The important thing is where the link is pointing to -
>> this you decide in the <binding element.
>> Cheers,
>> Ron
>>
>>
>> Alex Kartashev wrote:
>>
>>> Hi guys,
>>>
>>> I am a new Tapestry 4 user. I've been researching Tapestry 4 for
>>> about a week now, even developed some toy apps. I am already sold on
>>> the value proposition.
>>>
>>> One thing I am a bit confused about is Component parameters and
>>> properties.
>>>
>>> 1. Is there any difference between a component parameter and
>>> property? Or are these words used interchangeably?
>>>
>>> 2. Whereas lifecycle of page properties is very clear: pages are
>>> pooled and their properties are cleared out upon returning to the
>>> pool, components are not pooled independently but along with their
>>> pages. So, what about they properties/parameters? Will they be
>>> cleared out automatically as well?
>>>
>>>
>>> Thank a lot in advance,
>>>
>>> Alex
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Component Parameters and Properties
Posted by Alex Kartashev <al...@gmail.com>.
Very nice analogy on Unix symlink! I think I understand now the concept
of a component parameter (the Users Guide is an invaluable resource
there, I must say).
What about the lifecyle of a component property? All I want to make sure
is that they will be reset once the containing page goes back to the pool.
Thanks,
Alex
Ron Piterman wrote:
> just another thing : parameters function very much like symlinks in
> linux/unix -
> when you read them you actually read the target of the link, and when
> you write to them you change the target of the link -
> The important thing is where the link is pointing to -
> this you decide in the <binding element.
> Cheers,
> Ron
>
>
> Alex Kartashev wrote:
>
>> Hi guys,
>>
>> I am a new Tapestry 4 user. I've been researching Tapestry 4 for
>> about a week now, even developed some toy apps. I am already sold on
>> the value proposition.
>>
>> One thing I am a bit confused about is Component parameters and
>> properties.
>>
>> 1. Is there any difference between a component parameter and
>> property? Or are these words used interchangeably?
>>
>> 2. Whereas lifecycle of page properties is very clear: pages are
>> pooled and their properties are cleared out upon returning to the
>> pool, components are not pooled independently but along with their
>> pages. So, what about they properties/parameters? Will they be
>> cleared out automatically as well?
>>
>>
>> Thank a lot in advance,
>>
>> Alex
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Component Parameters and Properties
Posted by Ron Piterman <rp...@gmx.net>.
just another thing : parameters function very much like symlinks in
linux/unix -
when you read them you actually read the target of the link, and when
you write to them you change the target of the link -
The important thing is where the link is pointing to -
this you decide in the <binding element.
Cheers,
Ron
Alex Kartashev wrote:
> Hi guys,
>
> I am a new Tapestry 4 user. I've been researching Tapestry 4 for about a
> week now, even developed some toy apps. I am already sold on the value
> proposition.
>
> One thing I am a bit confused about is Component parameters and properties.
>
> 1. Is there any difference between a component parameter and property?
> Or are these words used interchangeably?
>
> 2. Whereas lifecycle of page properties is very clear: pages are pooled
> and their properties are cleared out upon returning to the pool,
> components are not pooled independently but along with their pages. So,
> what about they properties/parameters? Will they be cleared out
> automatically as well?
>
>
> Thank a lot in advance,
>
> Alex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Component Parameters and Properties
Posted by Ron Piterman <rp...@gmx.net>.
properties are to maintain internal component state, while parameters
are the tying the component to its container.
properties are (in the simple case) a "shortcut" for implementing real
Pojo properties for your page/component - but they offer some extras,
like persistance -
parameters update automatically and you can not set them - if you do
call "setXXX" on a parameter, it will either end up in an exception, or
will update some object outside your component, but it will *not* "just"
change the parameter.
say you have an InsertText component inside a loop -
you bind the value parameter to some property of the container, and the
text that will be rendered on each iteration will be different -
depending on the "value" parameter -
Hope that helps,
Ron
Alex Kartashev wrote:
> Hi guys,
>
> I am a new Tapestry 4 user. I've been researching Tapestry 4 for about a
> week now, even developed some toy apps. I am already sold on the value
> proposition.
>
> One thing I am a bit confused about is Component parameters and properties.
>
> 1. Is there any difference between a component parameter and property?
> Or are these words used interchangeably?
>
> 2. Whereas lifecycle of page properties is very clear: pages are pooled
> and their properties are cleared out upon returning to the pool,
> components are not pooled independently but along with their pages. So,
> what about they properties/parameters? Will they be cleared out
> automatically as well?
>
>
> Thank a lot in advance,
>
> Alex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Component Parameters and Properties
Posted by Ivano <i....@mclink.it>.
The difference is substantial:
Both Pages and Components have Properties associated which are set and
cleared for each instance.
Since you're reusing components inside pages and other containing
components you need to pass values that configure the inner component
for the individual use.
e.g. You can use PageLink component in many contexts and each time you
need to specify the destination page. So you use the "page" parameter
and assign it through the component binding and the tag attribute. This
parameter is then "internally" bound to one of the PageLink properties,
but you as a component user need not be aware of that.
Hope it clears some foggy... =)
Ivano Pagano.
Alex Kartashev wrote:
> Hi guys,
>
> I am a new Tapestry 4 user. I've been researching Tapestry 4 for about
> a week now, even developed some toy apps. I am already sold on the
> value proposition.
>
> One thing I am a bit confused about is Component parameters and
> properties.
>
> 1. Is there any difference between a component parameter and property?
> Or are these words used interchangeably?
>
> 2. Whereas lifecycle of page properties is very clear: pages are
> pooled and their properties are cleared out upon returning to the
> pool, components are not pooled independently but along with their
> pages. So, what about they properties/parameters? Will they be cleared
> out automatically as well?
>
>
> Thank a lot in advance,
>
> Alex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org