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

Tony Fleig tony.fleig at gmail.com
Thu Jan 6 03:07:07 UTC 2011


I have attached a fileout of your app that works correctly in my
environment. I did not change any of your code. All three examples
worked "out-of-the-box".

The only thing of importance that I did add was the class initialize,
which you did not mention in your email:

initialize
	"EduardMaydanik initialize"
	| application |
	application := WAAdmin register: self asApplicationAt: 'EduardMaydanik'.
	application preferenceAt: #scriptGeneratorClass put: JQScriptGenerator.
	application
		addLibrary: JQDeploymentLibrary.

Maybe you didn't load the library or something?

Regards,
TF

On Tue, Jan 4, 2011 at 11:31 AM, Eduard Maydanik <eduard at maydanik.de> wrote:
> 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
>
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EduardMaydanik.st
Type: application/octet-stream
Size: 3190 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110105/8961aeb7/EduardMaydanik-0001.obj


More information about the seaside mailing list