about <set> and <binding>, they just do the same(or very similar) thing

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

about <set> and <binding>, they just do the same(or very similar) thing

liigo
please look on <set> and <binding>, they just do the same(or very similar)
thing,
why not use the same keywork <set>?


<bean name="passwordValidator"
class="org.apache.tapestry.valid.StringValidator">
     <set name="minLength" value="6"/>
     <set name="maxLength" value="12"/>
</bean>

<component id="password" type="TextField">
     <binding name="value" value="ognl:user.password"/>
     <binding name="label" value="Password"/>
</component>


if all use <set>, we can write this:

<component id="password" type="TextField">
     <SET name="value" value="ognl:user.password"/>
     <SET name="label" value="Password"/>
</component>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: about <set> and <binding>, they just do the same(or very similar) thing

Howard Lewis Ship
<binding> creates a binding object (an instance of IBinding) that
knows about the page (*) and can read/update OGNL expression rooted in
the page.  The binding is passed into the component so that it can
gain access to properties of the page.  The <set> element is more
traidtional, a value is obtained and injected in (set and forget).
Parameters and bindings are bi-directional, the component can (via the
binding) change the properties of the page.


(*) I use the term page for clarity, it's really the container of the
component which is often a page, but nearly as often, another
component.

On 5/7/05, Michael Echerer <[hidden email]> wrote:

> liigo wrote:
> > please look on <set> and <binding>, they just do the same(or very similar)
> > thing,
> > why not use the same keywork <set>?
> >
> Internally "binding" is much more than just setting a property. A
> static-binding is more comparable to set. Anyhow this can be confusing
> in the beginning (especially the directions).
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]