You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vjeran Marcinko <ma...@jware.net> on 2004/01/03 09:25:33 UTC

Confusion with bean properties

Hi.

I am just wondering why is setting bean properties done differently than setting some component's parameters ?
There is <set-property> and <set-message-property>, but no <set-static-property> ? I spent some time figuring out how to set string value to some bean property, and then found in some example :
<set-property name="motherName">"Johanna S. Green"</set-property>

Or am I just confused with something since I mix properties and binding parameters sometimes ?

BR,
Vjeran


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


Re: Confusion with bean properties

Posted by Harish Krishnaswamy <hk...@comcast.net>.

Vjeran Marcinko wrote:

> Hi.
> 
> I am just wondering why is setting bean properties done differently than setting some component's parameters ?

Because the values for the bean properties are *not* dynamically obtained from the expression 
instead they are computed once and stored for the life of the bean. OTOH, values for parameters are 
dynamically obtained from the bound expression.

> There is <set-property> and <set-message-property>, but no <set-static-property> ? I spent some time figuring out how to set string value to some bean property, and then found in some example :
> <set-property name="motherName">"Johanna S. Green"</set-property>

The value for the property is actually an OGNL expression, and strings can be represented as OGNL 
expressions and hence there is no need for a special <set-static-property>.

-Harish

> 
> Or am I just confused with something since I mix properties and binding parameters sometimes ?
> 
> BR,
> Vjeran
> 
> 
> ---------------------------------------------------------------------
> 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: Confusion with bean properties

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
As Harish noted, you're kind of seeing the evolution of Tapestry and the integration of OGNL. Rather
than have all sorts of different types of property setters, we rely on OGNL (which can represent a
'static' string or a dynamic property expression).

If  I was redesigning Tapestry from scratch, I would probably never have put <static-binding> in
place.  <message-binding> is still useful, though <inherited-binding> no longer is (because of
connected parameter properties).

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Vjeran Marcinko [mailto:marcinko@jware.net] 
> Sent: Saturday, January 03, 2004 3:26 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Confusion with bean properties
> 
> 
> Hi.
> 
> I am just wondering why is setting bean properties done 
> differently than setting some component's parameters ?
> There is <set-property> and <set-message-property>, but no 
> <set-static-property> ? I spent some time figuring out how to 
> set string value to some bean property, and then found in 
> some example :
> <set-property name="motherName">"Johanna S. Green"</set-property>
> 
> Or am I just confused with something since I mix properties 
> and binding parameters sometimes ?
> 
> BR,
> Vjeran
> 
> 
> ---------------------------------------------------------------------
> 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