registerObjectForBacktracking

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

registerObjectForBacktracking

NorbertHartl
Hi,

I know this is a subject that comes along on a regular
base :) But in all pages I found I cannot say that I
understand it completely. I want to know what is this
call exactly for.

If I have a component which consists of sub-components
I have to take care what is returned by the children
call. I know it works without but it causes problems.
I don't know exactly when the problem arises.
Same is with sub-components which are stored in an
ivar and which get exchanged according to the state
of the component.

So when do I have to use registerObjectForBacktracking?

- If I use sub-components in an ivar and want to be sure
  the back button is working properly?
- Any other cases?
- Are the children call and the registerObjectForBacktracking
  somehow exchangeable?

thanks in advance,

Norbert

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

Re: registerObjectForBacktracking

Philippe Marschall
2007/3/8, Norbert Hartl <[hidden email]>:
> Hi,
>
> I know this is a subject that comes along on a regular
> base :) But in all pages I found I cannot say that I
> understand it completely. I want to know what is this
> call exactly for.

It reverts the state of the object when you hit the back button.

> If I have a component which consists of sub-components
> I have to take care what is returned by the children
> call.

Returning too much (e.g components that are not rendered) is in
general not a problem.

> I know it works without but it causes problems.
> I don't know exactly when the problem arises.
> Same is with sub-components which are stored in an
> ivar and which get exchanged according to the state
> of the component.

This is the most important use of #registerObjectForBacktracking:

> So when do I have to use registerObjectForBacktracking?

If you have state that needs to be backtracked ;)

> - If I use sub-components in an ivar and want to be sure
>   the back button is working properly?

Only If the contents of the ivars are changing over time.

> - Any other cases?

If you have any state that needs to be backtracked when the user hits
the back button. E.g. currently selected index of a batched list.

> - Are the children call and the registerObjectForBacktracking
>   somehow exchangeable?

No

Philippe

> thanks in advance,
>
> Norbert
>
> _______________________________________________
> 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