[Seaside] getting to the state of the previous continuation

Johan Brichau Johan.Brichau at uclouvain.be
Wed Jun 9 19:40:34 UTC 2010


Hi Julian,

Ok, that indeed confirms my findings. Thanks for your response.

Here is why I am looking at this: in some of our components, we have implemented an incremental rendering approach manually. This means that only the necessary changes are sent back to the client (using an ajax request), rather than a complete page refresh. We do this by tracking state changes to the component manually and use that information to create an appropriate ajax update script. This works great but we are looking to extract this idea for more generic use. Since Seaside is keeping the component state in its continuations, my intention is to use that information to determine the state delta. As a result, I need to link the current state to the previous state, hence my question.

This will obviously not work in all cases, but we've got several cases where a generic solution would alleviate much manual work. 

I don't know if keeping weak pointers is necessary. I might also use the key on the referer url of the request (although a bit hacky maybe).

On 09 Jun 2010, at 12:21, Julian Fitzell wrote:

> Hi Johan,
> 
> That sounds a bit strange. We don't currently maintain back pointers
> to the previous continuation - I suppose we could consider doing so as
> long as they were weak references (so they can still expire from the
> cache and get GC'ed). Perhaps that's the approach you should take in
> your subclassed continuations?
> 
> If you are able to elaborate a bit more on what you're trying to
> accomplish I might have a higher level idea for a good approach, but
> from what you've said, subclassing the continuations to maintain a
> weak back pointer seems like the best solution.
> 
> Julian
> 
> On Tue, Jun 8, 2010 at 3:41 PM, Johan Brichau
> <Johan.Brichau at uclouvain.be> wrote:
>> Hi everyone,
>> 
>> I'm trying to do some exotic stuff for which I need access to the state of the components in the continuation that precedes the currently rendering Seaside continuation.
>> 
>> So basically: I want to know if there is a way to get to the WASnapshot instance that captures the component states for the page that was previously rendered.
>> I'm currently looking at getting the _k parameter from the referer url in the request and using that to get the continuation from the continuations dictionary in the session. However, it seems a bit of a detour... so would there be a better way to do that?
>> 
>> I know, it's not something you normally want to do in a Seaside application.... I'm actually trying to implement a new renderphasecontinuation that needs this information from its precedessor...
>> 
>> ----------------------------
>> Johan Brichau
>> johan.brichau at uclouvain.be
>> 
>> 
>> 
>> 
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

----------------------------
Johan Brichau
johan.brichau at uclouvain.be






More information about the seaside mailing list