[Seaside] #children and Ajax
ssastre at seaswork.com
Sat Jan 19 16:43:06 UTC 2008
I'm not using it the feature right now but I had that problem and
Lukas gave me a clue to solve it.
The problem is when a component that was replaced with some AJAX
action remains obsolete when called by a backtrack.
My solution was to make an #obseletes instVar where I collect the
children components that are being obsoleted by this AJAX actions. So
#children will allways answer the actual valid children components but also
the obsoletes ones. The obsoletes are never rendered but in case of a
backtrack they make all work as expected.
Again, as I said, I was not convinced to use AJAX that way at all
until we have a full ajaxian backtrack solution.
> -----Mensaje original-----
> De: seaside-bounces at lists.squeakfoundation.org
> [mailto:seaside-bounces at lists.squeakfoundation.org] En nombre
> de itsme213
> Enviado el: Viernes, 18 de Enero de 2008 22:43
> Para: seaside at lists.squeakfoundation.org
> Asunto: [Seaside] #children and Ajax
> I'm encountering some seemingly not-systematic "Children Not
> Found while processing callbacks" that I don't understand.
> Perhaps I did not fully understand this earlier advice from Lukas:
> > - Don't try to replace children during AJAX actions without
> > precautions. E.g. you have to make sure that all the
> children you are
> > possibly going to show are returned by #children. See
> SUTabPanel and
> > SUAccordion for examples.
> Is it safe to dynamically add newly created components? These
> would not be in the previous call to #children, but will be
> included in the next #children e.g.
> ^ subComponents
> onClick: (html updater
> callback: [:r | subComponents add: C new.
> self basicRenderOn: r ])
> Thanks - Sophie
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside