Problem with Callbacks in Seaside

62 views
Skip to first unread message

Totally Objects

unread,
Jul 26, 2011, 11:22:45 AM7/26/11
to VA Smalltalk
Hi there.

I am using VAST 8.0.3.

I am trying to implement a back end server for an iPad app we are
writing. i would normally do this using WebConnection with which we
have years of experience.

However, I felt that I should do it this time using Seaside.

I am working my way through the ToDoList example from the book
'Dynamic Web development with Seaside' but I have run into a problem.

I am getting the following error:

Internal Error: a ContextEmulator
WAActionCallback>>#evaluateWithArgument:
arg1 = nil
not found while capturing continuation.

whilst processing the following code:

renderItem: anItem on: html

html listItem
class: 'done' if: anItem isDone;
class: 'overdue' if: anItem isOverdue;
with: [
html text:anItem title.
html space.
html anchor
callback: [ self edit: anItem ];
with: 'edit'.
html space.
html anchor
callback: [ self remove: anItem ];
with: 'remove' ]

Now I have been onto the old Instantiations Forum and have seen some
comments from John O'Keefe (Hi John) but to be honest, I couldn't
follow what he was saying.

Can anyone advise in pidgin English?

Thanks

jtu...@objektfabrik.de

unread,
Jul 26, 2011, 3:34:56 PM7/26/11
to va-sma...@googlegroups.com
Hi

Can anyone advise in pidgin English? 

at least I feel I am competent enough for that level, but I'll also try to help with the rest ;-)

Do you know if your callback method was called? It's best to prove by using a Breakpoint and configuring your root component to immediately pop up a debugger: 

(WAAdmin register: self asApplicationAt: 'MyApp')
exceptionHandler: WADebugExceptionHandler


I guess not. My first guess would be that you hit the edit link, see the editor and when this editor component tries to answer:, you get this error. If so, you're struck by the fact that VA ST doesn't yet support Continuations.
Unfortunately, this means that a good portion of the examples in the seaside bible do not work quite as they do in other dialects. You may want to take a look at an older blog post called Seaside: call: vs. show:onAnswer: that tries to help a little in understanding the differences. Not that I am an expert in Continuations, but I've become good in working without them and don't miss them.

HTH 

Joachim

SebastianHC

unread,
Jul 26, 2011, 11:09:59 PM7/26/11
to va-sma...@googlegroups.com
Hi David,

Joachim already mentioned that the issue in your case is the missing
continuations support in VAST.

I just exported myself the tutorial and provided some hacks just to enable
you to get a little easier insight into Seaside under VAST.

Please keep in mind:
- WATask go-Methods are intended to be used with continiuations or better
say the usage of #call:
- The lightboxes can only be implemented using jQuery. The Scriptaculous
implementation also uses continuations for this functionality.

I tweaked both things for you. This might give you an insight, why
WATask>>#go should use continuations. Just image a much more complex
workflow,... you wouldn't be able to understand all those ifTrue:/ifFalse:
stuff after a while.

One thing you might think about is using Announcements,... there's a package
available under vastgoodies.com. They help a little when you want to
implement more complex workflows within VAST.

I didn't introduce the jquery lightboxes in the sample. This would change
the codeing too much and it might be too hard for you to goon with your
approach.
I also didn't really take care of any thing else like the database
connections and so on. This exported app is just a way top help you getting
rid of the continuations related errors.
I would also not stay with this hackish implementation,... but for a
start,...

Maybe I'll wind the time next weekend to publish a real port on
VASTGoodies.com,... but only if it doesn't get to different to the
HPI-version.

If you might have trouble importing the app,... just let me know,.. I didn't
test it with a clean image.

Cheers!
Sebastian http://forum.world.st/file/n3697527/STTutTodoAppApp
STTutTodoAppApp

--
View this message in context: http://forum.world.st/Problem-with-Callbacks-in-Seaside-tp3696113p3697527.html
Sent from the Instantiations mailing list archive at Nabble.com.

jtu...@objektfabrik.de

unread,
Jul 27, 2011, 3:33:19 AM7/27/11
to va-sma...@googlegroups.com
Sorry, the class name should be WADebugErrorHandler...

Totally Objects

unread,
Jul 30, 2011, 12:19:54 PM7/30/11
to VA Smalltalk
Thanks for all of your help. Not sure that it was quite pidgen English
though - grin.

I found that I was just using the 'inform' method, which I didn't need
so i threw that away. I also changed call: to show; and am now running
fiine.

Thanks for all the help.

David

On Jul 27, 8:33 am, "jtuc...@objektfabrik.de"
Reply all
Reply to author
Forward
0 new messages