You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Pierce T. Wetter III" <pi...@paceap.com> on 2010/04/05 23:19:21 UTC

Question about property bindings vs. expansions


  Are these exactly the same or is there a subtle distinction between them?


     <a  href="${url}"></a>

     <a href="prop:url"></a>

    Pierce

Re: Question about property bindings vs. expansions

Posted by Howard Lewis Ship <hl...@gmail.com>.
The subtle difference is that prop:url is potentially a read/write
binding (the component could attempt to change its parameter which
would attempt to update the url property, if a settter method exists).

Expansions always result in a read-only value.

You can also do things like:

  <a href="mailto:${contactEmail}">Send mail to ${contactEmail}</a>


That is, you can mix text and expansions inside an attribute value to
result in the final string bound to the href parameter.

Finally, if an element is not a component, then prefixing an attribute
value with "prop:" will not convert it to binding, the literal text
"prop:url" will be sent to the client.


On Mon, Apr 5, 2010 at 2:40 PM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> On Mon, 05 Apr 2010 18:19:21 -0300, Pierce T. Wetter III <pi...@paceap.com>
> wrote:
>
>>  Are these exactly the same or is there a subtle distinction between
>> them?>
>>     <a  href="${url}"></a>
>
> This is the same as ${prop:url}. The prop binding is the default one for
> expressions and for the majority of components' parameters.
>
>>     <a href="prop:url"></a>
>
> I guess you meant <a href="${prop:url}"></a>.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: Question about property bindings vs. expansions

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 05 Apr 2010 18:19:21 -0300, Pierce T. Wetter III  
<pi...@paceap.com> wrote:

>   Are these exactly the same or is there a subtle distinction between  
> them?>
>      <a  href="${url}"></a>

This is the same as ${prop:url}. The prop binding is the default one for  
expressions and for the majority of components' parameters.

>      <a href="prop:url"></a>

I guess you meant <a href="${prop:url}"></a>.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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