[Seaside] Re: Re: Re: Re: Ajax callback question: how
toupdatecomponenttreebefore #children gets called?
itsme213
itsme213 at hotmail.com
Fri Feb 8 20:13:41 UTC 2008
"Lukas Renggli" <renggli at gmail.com> wrote in message
> the owner of all callbacks in your tab panel
> is the SUCounter that just disappeared. And there is
> nobody that takes care of these callbacks. Bummer.
Ah. This could make some kinds of Ajax difficult.
> I guess
> this solution could be applied to this problem as well and would solve
> many sleepless nights.
That would be great! Callback problems are the most difficult part of
Seaside for me to debug.
> Thanks for providing such a nice example to
> reproduce this problem.
My pleasure, its good to find some good side to my bad programming :-)
Below might be another pattern: an operation on (the domain model of) a
parent component is actually presented on a child component (the parent
configures the child).
House>>deleteRoom: aRoom
HouseComponent (model=house)
RoomComponent 1 (model=r1)
['delete'->[house deleteRoom:r1.
rend render: houseComponent]]
RoomComponent 2 (model=r2)
['delete'->[house deleteRoom:r2.
rend render: houseComponent]]
e.g. Desktop compound-document/component systems allow elements to negotiate
with parents/children/root about where menus appear. It would be awesome if
Seaside's architecture enabled similar composition flexibility. It would
mean that...
> Callbacks are normally processed in the context of the component that
> defines them (the owner).
... the component that presents a callback need not be the one that
"defined/owns" it. Not so much "homeless", more like "bind-and-relocate"
(bind: r1 or r2, relocate: from house to r1, r2).
Perhaps seaside components have a special notion of "environment" that could
be made explicit?
> This is usually not a problem, if you have a moderate number of children.
Good to know.
> Pay attention to use the right renderer. Even if it mostly works, I
> just noticed that there are some places where you use html within an
> AJAX callback.
Yikes! Even *I* should know better than to do that. A Lint smell?
As always, with many thanks.
Sophie
More information about the seaside
mailing list