[Seaside] getting to the state of the previous continuation
jfitzell at gmail.com
Wed Jun 9 22:11:09 UTC 2010
Yeah, I don't like the referer idea much. :) What about even storing
the key in the continuation? Each continuation is responsible for
creating the next continuation, so it should be quite easy to pass
that information in. I mean that's just a poor-man's weak reference,
of course... it really seems like it should be quite an easy
modification. I'd be interested in knowing whether it is helpful in
other cases and if there are any issues.
On Wed, Jun 9, 2010 at 8:40 PM, Johan Brichau
<Johan.Brichau at uclouvain.be> wrote:
> 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.
>> 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
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
> Johan Brichau
> johan.brichau at uclouvain.be
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside