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 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 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 |
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 |
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 |
> 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 |
Free forum by Nabble | Edit this page |