[Seaside] RE: Having one problem with WACounter tutorial

Cédrick Béler cbeler at enit.fr
Sat Jan 27 08:47:54 UTC 2007


> Ryan,
>
> You are using the WARenderCanvas to build the html
> which has different characteristics to WAHtmlRenderer,
> which is the renderer which supports the
> submitButtonWithAction:text: message.
>   
It is the old renderer used by default before the 2.7 seaside branch. 
Squeak-dev-72-2.image is using seaside 2.7 and the tutorial was written 
some time ago...
> MessageNotUnderstood:
> WARenderCanvas>>submitButtonWithAction:text:
>   
basically, you have to change the renderer or write the rendering code 
the new way... which is a cascading of messages instead of long specific 
messages (the changes of renderer was made to avoid to have to many 
methods...).
So how to convert the code...
first, maybe look at the messages names the include submit or better 
submitButton (alt + shift + w  with submitButton selected) then browse 
the different versions, you'll see #submitButtonWithAction:text: is 
defined in WAHtmlRenderer and #submitButton: is defined in 
WARenderCanvas, the new one...
So now to get examples on how #submitButton is used, select it and press 
(alt+n) to find the senders, you can also use the senders button in the 
menu of the browser... then you'll see the different uses of this 
message in your image...

you should then deduce something like:

html submitButton
    callback: [self increase] ;
    text: '++'

so first, try by changing the renderer in the class side and after maybe 
try to rewrite the new way

Cédrick
> Here's the code cut and pasted from the tutorial:
>
> renderContentOn: html
>     html form:  [
>        html heading: count.
>        html submitButtonWithAction: [self increase]
> text: '++'.
>        html space.
>        html submitButtonWithAction: [self decrease]
> text: '--'
>      ].
>
> Can anyone tell me what I am missing?
>   




More information about the Seaside mailing list