Rendering vs. Callback (was: Re: [Seaside] RE: seaside Digest, Vol
78, Issue 21)
renggli at gmail.com
Wed Jun 17 15:14:09 UTC 2009
> If I update an instance variable without using a callback or similar block,
> it will not update, correct?
It depends what you want to do?
If you want to count the number of times the page is generated, then
it will work.
If you want to count the number of times a certain link is clicked,
then you need a callback.
Btw, Slime points out such possible issues.
> whereas this does not:
> html anchor
> onClick: (self clickFunction: html onItem: (self resultList at: self
> text: 'Next Question'
The code you pass to #onClick: is evaluated when the page is
generated. If you don't know the action in advance, you need to do a
callback to the server. You can do this for example with an AJAX call
that returns a script:
onClick: (html jQuery ajax script: [ :script |
script add: (script jQuery: '#foo') effect explode ]);
with: 'A link'
More information about the seaside