[Seaside] Sample Seaside 2.6 form usage?

Rick Flower rickf at ca-flower.com
Fri Mar 3 16:59:04 UTC 2006


Michel Bany wrote:
> [ ... ]
>>
>>    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.
Sorry.. #a/b were side effects of commenting out code..
> Also you may want to combine
>       html attributes value: 'Login!'.
>       html submitButton.
> as
>       html submitButtonWithText: 'Login!'.
Cool.. Good to know!

> I do not have a sample form usage, but the Canvas version of your code 
> would look like this
>
>   (html form)
>       defaultAction: [self confirmLogin];
>       with:
>            [(html heading)
>                level3;
>                with: 'Welcome to my site'.
>            html bold: 'Enter login name:'.
>            (html textInput)
>                withValue: '';
>                callback: [:v | self login: v].
>            html
>                break;
>                break;
>                space: 3;
>                bold: 'Enter password:'.
>            (html passwordInput)
>                callback: [:c | self password: ((MD5 hash: c) 
> asHexString asLowercase) ].
>            html paragraph.
>            (html submitButton)
>                text: 'Login!'].
>
Excellent.. I did have to change the above "withValue:" line to be 
"value:" since withValue doesn't exist.. I searched through the example 
code looking for other areas that used "textInput" and found that.. 
Thanks for the rest of the help.. The form appears to be working as 
expected.. Much thanks!

-- Rick



More information about the Seaside mailing list