[Seaside] How to write server data request from client side using seaside

Eduard Maydanik eduard at maydanik.de
Tue Jan 4 19:31:00 UTC 2011


HI I am working with WebVelocity 1.1a:

 

 

this is a simple test. 

It should start on client side(jQuery -> onClick event) -> get value from a
server(ajax -> clicks ) -> apply this value on client side(jQuery ->  alert)
.

 

renderContentOn: html

               "clicks is an instance variable, initialized as 1 "

               (html anchor)

                              onClick: (html jQuery ajax script: 

 
[:s |

 
s alert: clicks printString.

 
clicks := clicks + 1]);

                              onClick: 'return false';

                              url: '#';

                              with: 'Test'

 

 

It shows all times original value only.

 

If I change it to:

 

               (html anchor)

                              onClick: (html jQuery ajax script: 

 
[:s |

 
s alert: Time now printString]);

                              onClick: 'return false';

                              url: '#';

                              with: 'Test'

 

It shows right behavior. On each click right time. 

If I change my code it to similar:

 

              (html anchor)

                              onClick: (html jQuery ajax script: 

 
[:s |

 
s alert: self increaseClick]);

                              onClick: 'return false';

                              url: '#';

                              with: 'Test'

 

increaseClick

 

               ^ clicks := clicks + 1.

 

It shows again original value only.

 

What is wrong? Or if it's a right behavior for this code -  how it should be
redone to show clicks number?

 

Can you point me on code example?

 

Best regards,

Eduard

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110104/4710759c/attachment.htm


More information about the seaside mailing list