You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jesse Kuhnert <jk...@gmail.com> on 2005/08/16 16:59:25 UTC

Component parameter binding

I'm having a little trouble getting my head around this one. 

I've got a component, A , which has a paramter binding to an object. 

This binding is a property of Page p that contains component A. Page p
sets this parameters binding to be that of the pages property.

Selecting and updating this property works wonderfully, so long as the
property is updated within a listener method of the page itself. If
however, a listener method (direct) is invoked on component A, and
component A attempts to update the property on itself (hoping that
bindings are magical I assume) the change is not seen or persisted
within the pages binding.

Does component A need to reference an IBinding for getting and
updating its property instead of the actual object in order to be able
to update the value? Or...Is it because the object bound to the
components property didn't exist on the initial render so the logic
doesn't recognize any updates made?

This is very non-obvious behaviour as far as I can tell. I've also
tried specifying cache="false" on the components parameter. I know I
could hack something in to get a reference to the containing
page....Or perhaps call commitPageChanges() ? No idea.

jesse

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


Re: Component parameter binding

Posted by Jesse Kuhnert <jk...@gmail.com>.
Yes....In yet another fit of retardation I forgot that I was
re-setting the property in question on the main page component in the
pageBeginRender block....The parameter/property binding logic is very
magical and nice :)

On 8/16/05, Howard Lewis Ship <hl...@gmail.com> wrote:
> The 4.0 implementation of connected parameter properties is very, very
> smart. It's not like 3.0, where you had to worry about parameter
> "direction". It's designed to Just Work (tm).
> 
> On 8/16/05, Jesse Kuhnert <jk...@gmail.com> wrote:
> > Ahhh...Nevermind. Everything works as expected. :/ ......
> >
> > On 8/16/05, Jesse Kuhnert <jk...@gmail.com> wrote:
> > > I'm having a little trouble getting my head around this one.
> > >
> > > I've got a component, A , which has a paramter binding to an object.
> > >
> > > This binding is a property of Page p that contains component A. Page p
> > > sets this parameters binding to be that of the pages property.
> > >
> > > Selecting and updating this property works wonderfully, so long as the
> > > property is updated within a listener method of the page itself. If
> > > however, a listener method (direct) is invoked on component A, and
> > > component A attempts to update the property on itself (hoping that
> > > bindings are magical I assume) the change is not seen or persisted
> > > within the pages binding.
> > >
> > > Does component A need to reference an IBinding for getting and
> > > updating its property instead of the actual object in order to be able
> > > to update the value? Or...Is it because the object bound to the
> > > components property didn't exist on the initial render so the logic
> > > doesn't recognize any updates made?
> > >
> > > This is very non-obvious behaviour as far as I can tell. I've also
> > > tried specifying cache="false" on the components parameter. I know I
> > > could hack something in to get a reference to the containing
> > > page....Or perhaps call commitPageChanges() ? No idea.
> > >
> > > jesse
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> 
> 
> --
> 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: 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 parameter binding

Posted by Howard Lewis Ship <hl...@gmail.com>.
The 4.0 implementation of connected parameter properties is very, very
smart. It's not like 3.0, where you had to worry about parameter
"direction". It's designed to Just Work (tm).

On 8/16/05, Jesse Kuhnert <jk...@gmail.com> wrote:
> Ahhh...Nevermind. Everything works as expected. :/ ......
> 
> On 8/16/05, Jesse Kuhnert <jk...@gmail.com> wrote:
> > I'm having a little trouble getting my head around this one.
> >
> > I've got a component, A , which has a paramter binding to an object.
> >
> > This binding is a property of Page p that contains component A. Page p
> > sets this parameters binding to be that of the pages property.
> >
> > Selecting and updating this property works wonderfully, so long as the
> > property is updated within a listener method of the page itself. If
> > however, a listener method (direct) is invoked on component A, and
> > component A attempts to update the property on itself (hoping that
> > bindings are magical I assume) the change is not seen or persisted
> > within the pages binding.
> >
> > Does component A need to reference an IBinding for getting and
> > updating its property instead of the actual object in order to be able
> > to update the value? Or...Is it because the object bound to the
> > components property didn't exist on the initial render so the logic
> > doesn't recognize any updates made?
> >
> > This is very non-obvious behaviour as far as I can tell. I've also
> > tried specifying cache="false" on the components parameter. I know I
> > could hack something in to get a reference to the containing
> > page....Or perhaps call commitPageChanges() ? No idea.
> >
> > jesse
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
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: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Component parameter binding

Posted by Jesse Kuhnert <jk...@gmail.com>.
Ahhh...Nevermind. Everything works as expected. :/ ......

On 8/16/05, Jesse Kuhnert <jk...@gmail.com> wrote:
> I'm having a little trouble getting my head around this one.
> 
> I've got a component, A , which has a paramter binding to an object.
> 
> This binding is a property of Page p that contains component A. Page p
> sets this parameters binding to be that of the pages property.
> 
> Selecting and updating this property works wonderfully, so long as the
> property is updated within a listener method of the page itself. If
> however, a listener method (direct) is invoked on component A, and
> component A attempts to update the property on itself (hoping that
> bindings are magical I assume) the change is not seen or persisted
> within the pages binding.
> 
> Does component A need to reference an IBinding for getting and
> updating its property instead of the actual object in order to be able
> to update the value? Or...Is it because the object bound to the
> components property didn't exist on the initial render so the logic
> doesn't recognize any updates made?
> 
> This is very non-obvious behaviour as far as I can tell. I've also
> tried specifying cache="false" on the components parameter. I know I
> could hack something in to get a reference to the containing
> page....Or perhaps call commitPageChanges() ? No idea.
> 
> jesse
>

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