Updaters clicks and changes on (sub)components

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Updaters clicks and changes on (sub)components

Sebastian Sastre-2
Hi there,

        I have some updaters that are evaluated when the user clicks
somewhere. This works just fine when the user perform a click on the hooked
component.

        The problem arrives when the user makes two quick clicks in it
instead on one. For most cases there is no problem at all but, if in the
callback of the updater exist some message that removes a children of the
updated component, then the second updater makes continuations complain
about not finding that children to receive the action.

        Anybody has ideas on how to prevent this kind of problem?

        thanks,

Sebastian Sastre


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Updaters clicks and changes on (sub)components

Lukas Renggli
>         The problem arrives when the user makes two quick clicks in it
> instead on one. For most cases there is no problem at all but, if in the
> callback of the updater exist some message that removes a children of the
> updated component, then the second updater makes continuations complain
> about not finding that children to receive the action.

Two possible solutions:

1. backtracking of the children (don't know if this works as expected with AJAX)

2. #children is supposed to return all children that you *might*
display. You can also return more (e.g. the old and the new one)

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Updaters clicks and changes on (sub)components

Sebastian Sastre-2
> Two possible solutions:
>
> 1. backtracking of the children (don't know if this works as
> expected with AJAX)
>
I've tried by implementing #states returning all the children but it didn't
work.

> 2. #children is supposed to return all children that you
> *might* display. You can also return more (e.g. the old and
> the new one)
>
Oh yeah this one did it ! Thanks a lot!!

Cheers,
Sebastian
PS: some care I'm having to take to prevent the second action interfere with
the first but that's another story.

> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Updaters clicks and changes on (sub)components

Lukas Renggli
> > 1. backtracking of the children (don't know if this works as
> > expected with AJAX)
> >
> I've tried by implementing #states returning all the children but it didn't
> work.

As always, you have to return from #states the object which contents
you want to backtrack, not the objects themselves.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Updaters clicks and changes on (sub)components

Sebastian Sastre-2

> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En nombre
> de Lukas Renggli
> Enviado el: Domingo, 25 de Noviembre de 2007 19:34
> Para: Seaside - general discussion
> Asunto: Re: [Seaside] Updaters clicks and changes on (sub)components
>
> > > 1. backtracking of the children (don't know if this works as
> > > expected with AJAX)
> > >
> > I've tried by implementing #states returning all the
> children but it
> > didn't work.
>
> As always, you have to return from #states the object which
> contents you want to backtrack, not the objects themselves.
>
> Cheers,
> Lukas
>
Mmm I'm confused now. Let's see an example. I have a parent presenter A that
has children B and C. If I want to backtrack B and C then I thought that one
can achieve that by implementing in A
states
        ^ Array with: B with: C

That's the idea of the use of states right?

What I made to see if that solves that problem was to make states in the
homologous to A component to return all it's children (of that component
alone). As told, that didn't work.

        cheers,

Sebastian

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Updaters clicks and changes on (sub)components

Lukas Renggli
> Mmm I'm confused now. Let's see an example. I have a parent presenter A that
> has children B and C. If I want to backtrack B and C then I thought that one
> can achieve that by implementing in A
> states
>         ^ Array with: B with: C
>
> That's the idea of the use of states right?

This will backtrack the instance-variable of components B and C. I
don't think this is what you want.

What you need is to backtrack the references to B and C, in case you
replace those with different components. So in case you reference B
and C from instance-variables in A, then your state method needs to
look like:

states
     ^ Array with: self

This is exactly the same as it was before with #registerObjectForBacktracking:.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside