Having one problem with WACounter tutorial

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Having one problem with WACounter tutorial

kofno
My image is squeak-dev-72-2.image

When I'm trying to change the links in the counter to buttons (as
specified in the tutorial), I get this error:

MessageNotUnderstood: WARenderCanvas>>submitButtonWithAction:text:

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?
--
Ryan L. Bell
http://kofno.wordpress.com
http://kofno.blogger.com
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Having one problem with WACounter tutorial

carlo.t
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.

To modify your code to use the WAHtmlRenderer class
simply add or modify your classes >>rendererClass
method to answer WAHtmlRenderer.
e.g.
rendererClass
        ^ WAHtmlRenderer



My image is squeak-dev-72-2.image

When I'm trying to change the links in the counter to
buttons (as
specified in the tutorial), I get this error:

MessageNotUnderstood:
WARenderCanvas>>submitButtonWithAction:text:

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?
--
Ryan L. Bell
http://kofno.wordpress.com
http://kofno.blogger.com


 
____________________________________________________________________________________
Get your own web address.  
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: RE: Having one problem with WACounter tutorial

cbeler

> 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?
>  


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Having one problem with WACounter tutorial

Philippe Marschall
In reply to this post by kofno
2007/1/27, Ryan Bell <[hidden email]>:

> My image is squeak-dev-72-2.image
>
> When I'm trying to change the links in the counter to buttons (as
> specified in the tutorial), I get this error:
>
> MessageNotUnderstood: WARenderCanvas>>submitButtonWithAction:text:
>
> 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?

The tutorial was outdated. We wanted to update it for a long time but
never did it, I'm really sorry about that. So I just updated it. It
"should" work now.

Id would we cool if someone would review it (acutally Lukas promised
to review it if I update it ;) ).

Cheers
Phlippe
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Having one problem with WACounter tutorial

kofno
Thanks everybody! That took care of it.

On 1/27/07, Philippe Marschall <[hidden email]> wrote:

> 2007/1/27, Ryan Bell <[hidden email]>:
> > My image is squeak-dev-72-2.image
> >
> > When I'm trying to change the links in the counter to buttons (as
> > specified in the tutorial), I get this error:
> >
> > MessageNotUnderstood: WARenderCanvas>>submitButtonWithAction:text:
> >
> > 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?
>
> The tutorial was outdated. We wanted to update it for a long time but
> never did it, I'm really sorry about that. So I just updated it. It
> "should" work now.
>
> Id would we cool if someone would review it (acutally Lukas promised
> to review it if I update it ;) ).
>
> Cheers
> Phlippe
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


--
Ryan L. Bell
http://kofno.wordpress.com
http://kofno.blogger.com
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Having one problem with WACounter tutorial

Michel Bany-3
In reply to this post by Philippe Marschall

>
> The tutorial was outdated. We wanted to update it for a long time but
> never did it, I'm really sorry about that. So I just updated it. It
> "should" work now.
>
> Id would we cool if someone would review it (acutally Lukas promised
> to review it if I update it ;) ).
>
FWIW, the VisualWorks version of the tutorial was updated for the canvas
api.
http://www.cincomsmalltalk.com/CincomSmalltalkWiki/Seaside%20Tutorial
Michel.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside