Scriptaculous bug with inPlaceEditor ?

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

Scriptaculous bug with inPlaceEditor ?

Florian Minjat-2
Hi,
    I think I found a bug in scriptaculous with the use of the
InPlaceEditor. I use it inside a div. By changing the value the whole
div is updated. But when the div containing the inPlaceEditor is
updated, the InPlaceEditor doesn't work anymore. You can found
attached an very simple example of it (I commented the callback
because it doesn't change anything to uncomment it).
    The only solution I found is to move the InPlaceEditor out of the
div. But when it is in the middle of a complex renderer, it is not
very easy.
    Is this a normal behavior or a bug ?

Florian


'From Squeak3.9 of 7 November 2006 [latest update: #7067] on 10 January 2007 at 1:56:25 pm'!
SUComponent subclass: #WADOLTestInPlaceEditor
        instanceVariableNames: 'value'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'DonjOnLine-Seaside-Fuentes'!

!WADOLTestInPlaceEditor methodsFor: 'as yet unclassified' stamp: 'FM 1/10/2007 13:51'!
renderContentOn: html

        html div id: 'ipe'; with: [self renderIPEOn: html].
! !

!WADOLTestInPlaceEditor methodsFor: 'as yet unclassified' stamp: 'FM 1/10/2007 13:56'!
renderIPEOn: html
        value ifNil: [value _ 1].
       
        html text: 'value : ', value asString. html break.
        html text: 'change value : '.
        html span
              script: (html inPlaceEditor
                        cancelLink: false;
                        triggerInPlaceEditor: [ :val |  value _ val ];
" callback: [ :r | r render: value ];"
                        onComplete: (html updater id: 'ipe'; callback: [:r | self renderIPEOn: r] )
                ); with: value.
       
! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

WADOLTestInPlaceEditor class
        instanceVariableNames: ''!

!WADOLTestInPlaceEditor class methodsFor: 'as yet unclassified' stamp: 'FM 1/10/2007 13:52'!
canBeRoot
        ^ true! !

!WADOLTestInPlaceEditor class methodsFor: 'as yet unclassified' stamp: 'FM 1/10/2007 13:52'!
initialize
        (WADOLTestInPlaceEditor registerAsApplication: 'WADOLTestInPlaceEditor')  libraries add: SULibrary.! !


WADOLTestInPlaceEditor initialize!


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

Re: Scriptaculous bug with inPlaceEditor ?

Lukas Renggli
>     Is this a normal behavior or a bug ?

This is a common problem ...

>  onComplete: (html updater id: 'ipe'; callback: [:r | self renderIPEOn: r] )

... instead use ...

  onComplete: (html updater
    id: 'ipe';
    evalScripts: true;
    callback: [:r | self renderIPEOn: r])

and your in-place editor will work. The JavaScript script.aculo.us
library does not evaluate JavaScript code that comes from updates, you
have to enable that manually using #evalScripts:

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside