I can't access the WASession in a SeasideTesting session.

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

I can't access the WASession in a SeasideTesting session.

Sébastien Rocca-Serra-2
Hi,

I use SeasideTesting to test my application and I run into a problem
every time I need to access the WASession:
- the component session (self component session) is always nil.

Note: I run #establishSession in the #setUp.


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

Re: I can't access the WASession in a SeasideTesting session.

cdavidshaffer
Seb wrote:

> Hi,
>
> I use SeasideTesting to test my application and I run into a problem
> every time I need to access the WASession:
> - the component session (self component session) is always nil.
>
> Note: I run #establishSession in the #setUp.
>
>
> Any hints?
> Thanks!
> Seb.
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Seb,

How are you accessing the session?  In your test case you should be able
to send "self session" to get it.  If you are trying to use the dynamic
variable WACurrentSession or sending #session to your component then it
won't work b/c the dynamic binding is not on the call stack for the test
case.  So, for example,

testNothing
    self newApplicationWithRootClass: MyComponent.
    self establishSession.
    self assert: self session notNil

should pass but:

testNothing
    self newApplicationWithRootClass: MyComponent.
    self establishSession.
    self assert: self component session notNil

will not.

Hope that helps.

David

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

Re: I can't access the WASession in a SeasideTesting session.

Sébastien Rocca-Serra-2
It works: I was calling 'self component session'.

Very useful tool, thanks!
Seb.

David Shaffer a écrit :

> Seb,
>
> How are you accessing the session?  In your test case you should be able
> to send "self session" to get it.  If you are trying to use the dynamic
> variable WACurrentSession or sending #session to your component then it
> won't work b/c the dynamic binding is not on the call stack for the test
> case.  So, for example,
>
> testNothing
>    self newApplicationWithRootClass: MyComponent.
>    self establishSession.
>    self assert: self session notNil
>
> should pass but:
>
> testNothing
>    self newApplicationWithRootClass: MyComponent.
>    self establishSession.
>    self assert: self component session notNil
>
> will not.
>
> Hope that helps.
>
> David
>
>

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

SeasideAsync and default action

Carl Gundel
In reply to this post by Sébastien Rocca-Serra-2
I'm trying to move part of my application over to SeasideAsync, but I'm
having a little trouble with it.

My application has an interactive console, sort of like a command line.  At
the bottom, there is an textinput object and a submit button.  The user can
type something into the field (which by default has focus when it appears)
and either hit Enter or click on the submit button.  Depending on what they
do next (amongst other things) some text and or graphics may be added to the
console, and another textinput and submit button may appear.

I have no trouble using SeasideAsync with the textinput, and I replace the
submit button with an anchor.  This works okay as long at the user clicks on
the anchor.  However, I really want the user to be able to just hit Enter.
With non asynch Seaside, this is not a problem.  How can I handle the Enter
key with a live callback.  It is possible to have a default action for the
form that uses a live callback?

-Carl Gundel, author of Liberty BASIC
http://www.libertybasic.com


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

Re: SeasideAsync and default action

Lukas Renggli
> I have no trouble using SeasideAsync with the textinput, and I replace the
> submit button with an anchor.  This works okay as long at the user clicks on
> the anchor.  However, I really want the user to be able to just hit Enter.
> With non asynch Seaside, this is not a problem.  How can I handle the Enter
> key with a live callback.  It is possible to have a default action for the
> form that uses a live callback?

In Scriptaculous you could use something like this:

html textInput
   id: 'console';
   callback: [ :value | ... ];
   onEnter: (html request triggerFormElement: 'console')

I don't know how to compose scripts in SeasideAsync.

Lukas

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