[Seaside] Sample Seaside 2.6 form usage?

Michel Bany m.bany at wanadoo.fr
Fri Mar 3 07:52:00 UTC 2006

Rick Flower a écrit :

> Does anyone have a sample form usage that works with the new Canvas 
> API in Seaside 2.6+ that you'd like to share?
> I'm having some problems with my old school API version of a form and 
> am not sure what the problem is and after browsing
> my Seaside code, I'm not sure if the stuff I'm looking at is the old 
> or new.. By the way, why are a bunch of the Seaside classes
> now RED in VW after I upgraded my Seaside version from 2.5b8 to 2.6a2?
Let me make some assumption about what you actually did.
1) You started with VW 7.4
2) You loaded the SeasideForWebToolkit parcel into the image using the 
parcel manager;
the Seaside parcels on the VW distribution are for version 2.5b8
3) Thereafter you loaded the SeasideForWebToolkit bundle (version 
2.6a2.115.0 ?)
from the public repository

This is creating a mess (although it may work somehow). Instead, you 
should unload all
the Seaside parcels prior to loading from the public repository or even 
better, you should
rebuild a Seaside 2.6 image starting from a virgin image. In case you 
want to try the unload
method, the parcels to unload are SeasideBase, SeasideForWebToolkit and 

> Here' the form code that's giving me problems (note that most lines 
> are commented out for debugging purposes..) :
>    html form: [
>        html defaultAction: [self confirmLogin].
>        "html heading: 'Welcome to my site' level: 3."
>        "html bold: 'Enter login name:'."
>        "html textInputWithValue: '' callback: [:v | self login: v]."
>        "html br; br."
>        "html space; space; space; bold: Enter password:."
>        "html passwordInputWithCallback: [:c | self password: ((MD5 
> hash: c) asHexString asLowercase) ]."
>        "html paragraph."
>        "html attributes value: Login!."
>        "html submitButton."
>    ].
You did not say what symptoms are produced by your code.
However, I can quickly spot a few errors.
a) You need quotes around 'Enter password'.
b) You need quotes around 'Login!'
c) You should use #break rather than #br.

Also you may want to combine
       html attributes value: 'Login!'.
       html submitButton.
       html submitButtonWithText: 'Login!'.

I do not have a sample form usage, but the Canvas version of your code 
would look like this

   (html form)
       defaultAction: [self confirmLogin];
            [(html heading)
                with: 'Welcome to my site'.
            html bold: 'Enter login name:'.
            (html textInput)
                withValue: '';
                callback: [:v | self login: v].
                space: 3;
                bold: 'Enter password:'.
            (html passwordInput)
                callback: [:c | self password: ((MD5 hash: c) 
asHexString asLowercase) ].
            html paragraph.
            (html submitButton)
                text: 'Login!'].


> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the Seaside mailing list