[Seaside] Re: How did you solve the ajax & back browser button
Esteban A. Maringolo
emaringolo at gmail.com
Wed May 28 14:03:39 UTC 2014
Could you post a small snippet of code of how you deal with the history
I can imagine how this could work using browser friendly URLs, but not when
dealing with sessions (unless you're using cookie tracking for sessions).
Esteban A. Maringolo
2014-05-28 10:47 GMT-03:00 Sabine Knöfel <sabine.knoefel at gmail.com>:
> Hi Paul and Johan,
> thank you for your answers! It took me some time to choose, understand and
> implement a solution, but I think, now I have it.
> As Paul assumes, I do not use the ajaxifier either, I write the callbacks
> by myself.
> I integrated history.js .
> I was just finishing it a few minutes before.
> If someone needs more informations about it please ask.
>  https://github.com/browserstate/history.js
> On Mon, May 19, 2014 at 6:57 PM, Johan Brichau-2 [via Smalltalk] <[hidden
> email] <http://user/SendEmail.jtp?type=node&node=4760713&i=0>> wrote:
>> Hi Sabine,
>> Aaaah... the joys of the back button server-side rendered ajax
>> As Paul points out, if you use the ajaxifier library, there is a solution
>> that uses the html5 history API .
>> The ajaxifier library transforms Seaside callbacks into browser ajax
>> requests on the client side. However, this means that they are still
>> executed as full page requests in Seaside itself.
>> If I remember correctly, it pushes the continuation key onto the state
>> history stack. A back button press can then make a call to fetch the
>> previous continuation.
>> It makes the use of ajax transparant, but it also defeats many of the use
>> cases for it (imho).
>> So you are probably not using the ajaxifier library (neither am I) and
>> you are writing the ajax calls yourself.
>> I'm afraid that means you have to implement a solution that fits your
>> needs as well :-( You will have to determine what it means to 'go to the
>> page before'. If it means 'going to the state before the last ajax call',
>> then you are in for some work.
>> I once tried to implement this (at esug 2012 in Gent actually) but I
>> never finished it. Here is what I tried to do:
>> Seaside ajax callbacks are changing the state of the current continuation
>> without copying the state and snapping off a new continuation. If you want
>> to be able to go back to the previous state before the ajax callback, an
>> ajax callback should first copy the session state (just as is done in a
>> full page request) before execution. The key for that state should go in
>> the history api (as in ). When a request for that state comes in, the
>> entire page should be re-rendered using the saved state.
>> I think this should be able to get working using the abstractions
>> available in Seaside and I would love to hack on that at ESUG this year.
>> Unfortunately, promising anything before that is just not going to happen
>> because of lack of time :-/
>>  http://html5doctor.com/history-api/
>> On 19 May 2014, at 14:23, Sabine Knöfel <[hidden email]<http://user/SendEmail.jtp?type=node&node=4759566&i=0>>
>> > Hi,
>> > my application does much with ajax calls and because of this, my
>> > history is nearly empty.
>> > There are, indepently from pharo and seaside, several solutions for
>> > problem described in the web.
>> > But after looking around for a while I want to ask how did (or how
>> > you solve this problem within pharo and seaside?
>> > I want that my users can click the back button and go to the "page
>> > Can I solve this with Seaside-REST? Which is the best way?
>> > Regards
>> > Sabine
>> > --
>> > View this message in context:
>> > Sent from the Seaside General mailing list archive at Nabble.com.
>> > _______________________________________________
>> > seaside mailing list
>> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4759566&i=1>
>> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>> seaside mailing list
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=4759566&i=2>
>> If you reply to this email, your message will be added to the
>> discussion below:
>> To start a new topic under Seaside General, email [hidden email]<http://user/SendEmail.jtp?type=node&node=4760713&i=1>
>> To unsubscribe from How did you solve the ajax & back browser button
>> problem?, click here.
> View this message in context: Re: How did you solve the ajax & back
> browser button problem?<http://forum.world.st/How-did-you-solve-the-ajax-back-browser-button-problem-tp4759490p4760713.html>
> Sent from the Seaside General mailing list archive<http://forum.world.st/Seaside-General-f86180.html>at Nabble.com.
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside