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

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


Just realized you are using WebVelocity and I am using Pharo. But at
least we know that your code works in the Pharo environment.

TF

On Wed, Jan 5, 2011 at 7:07 PM, Tony Fleig <tony.fleig at gmail.com> wrote:
> 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
>>
>>
>


More information about the seaside mailing list