[Seaside] disconnecting Comet?

Lukas Renggli renggli at gmail.com
Thu Jun 24 05:48:37 UTC 2010


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
>> 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


More information about the seaside mailing list