[Seaside] disconnecting Comet?

Bob Arning arning at charm.net
Thu Jun 24 13:14:03 UTC 2010


Lukas,

On Jun 24, 2010, at 8:44 AM, Lukas Renggli wrote:

> Are you sure that the definition (first branch) happens before the  
> second one?

Yes.

>
> Otherwise I don't know the problem. Can you provide a minimal one
> click reproduceable example? I or somebody else might find some time
> to have a look.

Try this:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bob002.st.gz
Type: application/x-gzip
Size: 677 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100624/2da1fd12/Bob002.st.bin
-------------- next part --------------



1. Filein code
2. Point your browser to <yourserver>/Bob2
3. Red rectangle displayed with 'aaa' inside. Comet is started.
4. Click on the red rectangle.
5. The 'aaa' is replaced by 'bbb' using jQuery. Comet is asked to  
disconnect, but it does not. Safari Web Inspector indicates an error  
at this point.

Cheers,
Bob

>
> Lukas
>
> On Thursday, June 24, 2010, Bob Arning <arning at charm.net> wrote:
>> Still no luck:
>>
>>        needPusher ifTrue: [
>>                html document
>>                        addLoadScript: (s _ html comet
>>                                assignTo: 'window.mainPusher';
>>                                pusher: mainPusher;
>>                                connect)
>>        ] ifFalse: [
>>                html document
>>                        addLoadScript: (s _ html comet alias:  
>> 'window.mainPusher'; disconnect)
>>        ].
>>
>> produces these:
>>
>>        window.mainPusher=new Comet("/MedApp2? 
>> _s=PLi0mWeSRKJiXts8&_k=Ed3BRVBWVr6YUWeF&_c=s45ahKGj0Q- 
>> JDXUa").connect()
>>
>>        window.mainPusher.disconnect()
>>
>> and the latter results in:
>>
>>        TypeError: Result of expression  
>> 'window.mainPusher' [undefined] is not an object.
>>
>> Cheers,
>> Bobt
>>
>> On Jun 24, 2010, at 1:48 AM, Lukas Renggli wrote:
>>
>>
>> Force it to be come a global, by naming it:
>>
>>   window.mainPusher
>>
>> Lukas
>>
>> On 24 June 2010 00:46, Bob Arning <arning at charm.net> wrote:
>>
>> When connecting, the javascript is:
>>
>>       mainPusher=new
>> Comet("/MedApp2?_s=bEiBuI- 
>> qIbOt87Kg&_k=Qwt9Y5JhAVsHwWHn&_c=onXPmtUEWH6qh-9R").connect()
>>
>> and when I disconnect, it is:
>>
>>       mainPusher.disconnect()
>>
>> I opened the Safari debugging window and noticed an error:
>>
>>       TypeError: Result of expression 'mainPusher' [undefined] is  
>> not an
>> object.
>>
>> So, I guess it still needs some tweaking.
>>
>> Cheers,
>> Bob
>>
>> On Jun 23, 2010, at 5:52 PM, Lukas Renggli wrote:
>>
>>
>> How does the generated Javascript look like?
>>
>> Lukas
>>
>> On 23 June 2010 23:45, Bob Arning <arning at charm.net> wrote:
>>
>>
>> Lukas,
>>
>> Still doesn't seem to work. I now have
>>
>>      needPusher ifTrue: [
>>              html document
>>                      addLoadScript: (html comet
>>                              assignTo: 'mainPusher';
>>                              pusher: mainPusher;
>>                              connect)
>>      ] ifFalse: [
>>              html document
>>                      addLoadScript: (html comet alias: 'mainPusher';
>> disconnect)
>>      ].
>>
>>
>> as the last bit of my response generation and it will start comet,  
>> but
>> never
>> manages to turn off the spinning indicator.
>>
>> Cheers,
>> Bob
>>
>> P.S. I did enter a bug report for the previous version.
>>
>> On Jun 23, 2010, at 5:02 PM, Lukas Renggli wrote:
>>
>>
>> That could, and probably should be made to work like you wrote. Can
>> you create a bug report?
>>
>> Until then you need to store your pusher like this:
>>
>>  html comet
>>   assignTo: 'mainPusher';
>>   pusher: mainPusher;
>>   connect
>>
>> And disconnect it like this:
>>
>>  html comet
>>   alias: 'mainPusher';
>>   disconnect
>>
>> This assigns the pusher object to a variable on the client side, and
>> calls the same object again to disconnect.
>>
>> Lukas
>>
>> On 23 June 2010 19:01, Bob Arning <arning at charm.net> wrote:
>>
>>
>> Hi,
>>
>> Once I have connected Comet to a page, is there a way to disconnect  
>> it
>> without completely re-rendering the page? I have this in my response
>> generating code:
>>
>>     needPusher ifTrue: [
>>             html document
>>                     addLoadScript: (html comet
>>                             pusher: mainPusher;
>>                             connect)
>>     ] ifFalse: [
>>             html document
>>                     addLoadScript: (html comet pusher: mainPusher;
>> disconnect)
>>     ].
>>
>> and it will start a pusher, but doesn't seem to be able to stop one
>> (like
>> make the browser loading indicator stop spinning).
>>
>> Thoughts?
>>
>> Thank,
>> Bob
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>>
>>
>>
>> --
>> Lukas Renggli
>> www.lukas-renggli.ch
>> _______________________________________________
>> 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
>>
>>
>>
>>
>>
>> --
>> Lukas Renggli
>> www.lukas-renggli.ch
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> <
>
> -- 
> Lukas Renggli
> www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list