Cannot use scriptaculous package in own project

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

Cannot use scriptaculous package in own project

Paul Mateescu
Hello,

I have downloaded the scriptaculous package (Scriptaculous-lr.70). The
scriptaculous demo application works OK.

I am trying to use the inPlaceEditor as follows:

I defined a root class, FIApp as a subclass of a WAComponent, and in
the renderContentOn: method I have pasted the code from the
SUInPlaceEditorTest:

html paragraph
                script: (html inPlaceEditor
                        callback: [ :value :renderer | renderer render: (text := value) ];
                        cancelText: '');
                with: text.
...

The renderContentOn: method also renders some other stuff.

But whenever I try to visualize a FIApp session in a browser, I get the
following error:

"Error: This block accepts 2 arguments, but was called with 1."

I also include the rest of the error page at the end of this message.

Could you please tell me what am I doing wrong? So far I have only been
able to subclass SUInPlaceEditorTest and use it as a subcomponent.

Thank you,

Paul Mateescu


=========================================

The rest of the error page:

# BlockContext(Object)>>error:

     self [] in FIApp>>renderContentOn: {[:value :renderer | renderer
render: (text := value)]}
     temps
     aString 'This block accepts 2 arguments, but was called with 1.'
     inst vars
     sender nil
     pc 48
     stackp 0
     nargs 2
     startpc 48
     home FIApp>>renderContentOn:

# BlockContext>>valueWithArguments:

     self [] in FIApp>>renderContentOn: {[:value :renderer | renderer
render: (text := value)]}
     temps
     anArray #(a WAHtmlRenderer)
     inst vars
     sender nil
     pc 48
     stackp 0
     nargs 2
     startpc 48
     home FIApp>>renderContentOn:

# BlockContext>>value:

     self [] in FIApp>>renderContentOn: {[:value :renderer | renderer
render: (text := value)]}
     temps
     arg a WAHtmlRenderer
     inst vars
     sender nil
     pc 48
     stackp 0
     nargs 2
     startpc 48
     home FIApp>>renderContentOn:

# BlockContext>>renderOn:

     self [] in FIApp>>renderContentOn: {[:value :renderer | renderer
render: (text := value)]}
     temps
     aRenderer a WAHtmlRenderer
     inst vars
     sender nil
     pc 48
     stackp 0
     nargs 2
     startpc 48
     home FIApp>>renderContentOn:

# WAHtmlRenderer(WAAbstractHtmlBuilder)>>render:

     self a WAHtmlRenderer
     temps
     anObject [] in FIApp>>renderContentOn: {[:value :renderer |
renderer render: (text := value)]}
     inst vars
     attributeBuffer nil
     context a WARenderingContext
     callbacks a WACallbackRegistry

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

Re: Cannot use scriptaculous package in own project

cbeler
not sur but I think you need to use WARenderCanvas and not WAHtmlRenderer
don't know if it will solve your problem thought...

to do that, put on the instance side of your component:

rendererClass
    ^WARenderCanvas

Paul Mateescu a écrit :

> html paragraph
>         script: (html inPlaceEditor
>             callback: [ :value :renderer | renderer render: (text :=
> value) ];
>             cancelText: '');
>         with: text.

cascading messages shows you need to use WARenderCanvas...

> # WAHtmlRenderer(WAAbstractHtmlBuilder)>>render:
>
>     self    a WAHtmlRenderer
>     temps
>     anObject    [] in FIApp>>renderContentOn: {[:value :renderer |
> renderer render: (text := value)]}
>     inst vars
>     attributeBuffer    nil
>     context    a WARenderingContext
>     callbacks    a WACallbackRegistry
>
and you're using WAHtmlRenderer

hope this helps ;)

See you

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

Re: Cannot use scriptaculous package in own project

Paul Mateescu
Cédrick,

Yes, it worked perfectly!

Thank you,

Paul Mateescu


On May 6, 2006, at 6:21 PM, Cédrick Béler wrote:

> not sur but I think you need to use WARenderCanvas and not
> WAHtmlRenderer
> don't know if it will solve your problem thought...
>
> to do that, put on the instance side of your component:
>
> rendererClass
>    ^WARenderCanvas

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