Session is Lost (was Re: A progress bar for seaside)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Session is Lost (was Re: A progress bar for seaside)

Alejandro Martínez
Lost but not in an island.
i have this problem: If i want to access the seaside session inside de forWork block will answer nil, e.g:

    html div id: 'id1';   
        with: 'Opening...'
        waitMax: 30 seconds
        forWork: [ self session inspect halt. (Delay forSeconds: 10) wait. ]
        thenRender:[:r :value | r text: value]

the inspector shows nil.
what could be happening here?

i've followed the message chain over the WATagBrush down to this method in BlockContext and BlockClosure

valueWithing: onTimeout

but i cannot figure out from there how can i fix this one.

regards


2008/2/29, Alejandro Martínez <[hidden email]>:
thanks for your answer Ramon, it worked pretty fine.


2008/2/29, Ramon Leon <[hidden email]>:
>
> i need a progress bar for keeping the user notified about the
> state of an operation, the best what i've read for that until
> now is this :
>
> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://onsmalltalk.com/programming/smalltalk/polling-for-long-" target="_blank">http://onsmalltalk.com/programming/smalltalk/polling-for-long-
> running-processes/
>
> but when i tested i get an infinite recursion (i think).
> to test it, install the attached mcz on a test image, add an
> entry point with SULibrary and open a Transcript. i added a
> lot of output to understand what's happening.
> maybe more experienced developers (Ramon Leon?) could fix it
> or tell what's wrong?
>
> (note the callback of the periodical is never evaluated)


That artcle is a bit out of date, download my image and check out the
current version of those methods.  They work a bit differently now but I
still use them heavily and they work great.  I don't use the decay hack
anymore, I just send down some script and stop the polling.  I'm in a hotel
in New Hampshire at the moment so I don't have time to dig into any code,
but I can tell you what's in my image works well.

Ramon Leon
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://onsmalltalk.com/" target="_blank">http://onsmalltalk.com

_______________________________________________
seaside mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Session is Lost (was Re: A progress bar for seaside)

Ramon Leon-5
> Lost but not in an island.
> i have this problem: If i want to access the seaside session
> inside de forWork block will answer nil, e.g:
>
>     html div id: 'id1';    
>         with: 'Opening...'
>         waitMax: 30 seconds
>         forWork: [ self session inspect halt. (Delay
> forSeconds: 10) wait. ]
>         thenRender:[:r :value | r text: value]
>
> the inspector shows nil.
> what could be happening here?
>
> i've followed the message chain over the WATagBrush down to
> this method in BlockContext and BlockClosure
>
> valueWithing: onTimeout
>
> but i cannot figure out from there how can i fix this one.
>
> regards

Seaside sessions use dynamic variables, which fail as soon as you fork.  A
quick fix is to put this in your base component class...

session
        "this seems dumb, but sometimes the dynamic var that holds the
session is unexpectedly unavailable, like when forking a thread, this
ensures I can always access it"
        ^ session ifNil: [ session := WACurrentSession value ]

Then on first session access, the dynamic var is copied into a local
instance var that will be available no matter what, like during a fork.

Ramon Leon
http://onsmalltalk.com

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Double-click on listbox?

Carl Gundel
How can I register a callback on a listbox (select tag) for a double-click?  I'm (still) using Seaside 2.6.  Do web browsers support this sort of action?

Thanks,

-Carl Gundel
http://www.runbasic.com
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Double-click on listbox?

Lukas Renggli
> How can I register a callback on a listbox (select tag) for a double-click?  I'm (still) using Seaside 2.6.  Do web browsers support this sort of action?

No, but most web browser support it in one way or the other:

http://developer.mozilla.org/en/docs/DOM:element.ondblclick

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Double-click on listbox?

Bany, Michel
Hi Carl,
With SeasideAsync, I believe the following will work.

        html select
                ... ;
                forEvent: 'ondblclick' callback: [:e | ... ];
                ...
If you need the value of the selected item in the callback block, then
you also need to send liveCallback: since the live callback is triggered
by the onclick event and is therefore evaluated before the ondblclick
event.
HTH
Michel.



> > How can I register a callback on a listbox (select tag) for
> a double-click?  I'm (still) using Seaside 2.6.  Do web
> browsers support this sort of action?
>
> No, but most web browser support it in one way or the other:
>
> http://developer.mozilla.org/en/docs/DOM:element.ondblclick
>
> Lukas
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Double-click on listbox?

Lukas Renggli
>  If you need the value of the selected item in the callback block, then
>  you also need to send liveCallback: since the live callback is triggered
>  by the onclick event and is therefore evaluated before the ondblclick
>  event.

The road to huge troubles ... ;-)

   http://www.quirksmode.org/js/events_mouse.html#dblclick

Honestly, they are right on quirksmode.org.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside