Scriptaculous how to update when inplace editor saved.

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

Scriptaculous how to update when inplace editor saved.

keith1y
I want to update the display of another component having editied its
name with an inplace editor, and I cant see how to do it.


My editor:

html div id: (id := html nextId);
            script: ( html inPlaceEditor
                        id: id;
                        okButton:false;
                        okLink:false;
                     
                        triggerInPlaceEditor: [ :value | self
doRenameItem: stage to: value ];
                        callback: [ :r | r render: stage name ])  
             with: stage name

I want to trigger similarly to this when the editing is saved:

    html small: [
        html anchor
                onClick: (html evaluator
                        callback: [ :s | self  
onGraphChangedPerformUpdate: s ]);
                with: '(update)'
    ].

many thanks in advance

Keith



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

Re: Scriptaculous how to update when inplace editor saved.

Lukas Renggli
> I want to update the display of another component having editied its
> name with an inplace editor, and I cant see how to do it.

SUInPlaceEditor is a subclass of SUUpdater. So you can use all the
events available there, e.g. #onSuccess:

Lukas

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

Re: Scriptaculous how to update when inplace editor saved.

Igor Stasenko
On 25/06/07, Lukas Renggli <[hidden email]> wrote:
> > I want to update the display of another component having editied its
> > name with an inplace editor, and I cant see how to do it.
>
> SUInPlaceEditor is a subclass of SUUpdater. So you can use all the
> events available there, e.g. #onSuccess:
>
> Lukas
>
I want that too. What is most 'generic' way to run some js code after
update is completed (disregarding it's success)?
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Scriptaculous how to update when inplace editor saved.

Lukas Renggli
> I want that too. What is most 'generic' way to run some js code after
> update is completed (disregarding it's success)?

#onComplete:

Have a look at the excessive method comments in the #event protocol of SUAjax.

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

Re: Scriptaculous how to update when inplace editor saved.

keith1y
In reply to this post by Lukas Renggli
Lukas Renggli wrote:
>> I want to update the display of another component having editied its
>> name with an inplace editor, and I cant see how to do it.
>
> SUInPlaceEditor is a subclass of SUUpdater. So you can use all the
> events available there, e.g. #onSuccess:
>
> Lukas
>
Dear Lukas,

I tried the following wihout success

Keith

            script: ( html inPlaceEditor
                        id: id;
                        okButton:false;
                        okLink:false;
                        okText: 'ok';
                        cancelLink: false;
                        cancelText:'X';
                        triggerInPlaceEditor: [ :value | self
doRenameItem: stage to: value ];
                        "callback: [ :r | r render: stage name ];"
                        onSuccess: (html updater id: id; callback: [:r |
r render: stage name]);  
                         onSuccess: (html evaluator callback: [ :s |
self tellUserSelection onGraphChangedPerformUpdate: s])  
                    );
            with: [ html text: stage name ].
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Scriptaculous how to update when inplace editor saved.

keith1y
Keith Hodges wrote:

> Lukas Renggli wrote:
>>> I want to update the display of another component having editied its
>>> name with an inplace editor, and I cant see how to do it.
>>
>> SUInPlaceEditor is a subclass of SUUpdater. So you can use all the
>> events available there, e.g. #onSuccess:
>>
>> Lukas
>>
> Dear Lukas,
>
onComplete: worked, but onSuccess: did not.

(I removed the callback: as indicated in the method comment for onSuccess:)

fyi: I am using Scriptaculous 198-lr with Seaside 2.7b1 successfully.

However I do see a bug in the 'In Place Editor', whereby the second time
that you edit,
the text in the input field has collected some unwanted markup. I do not
know if this is a current issue.

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

Re: Scriptaculous how to update when inplace editor saved.

Lukas Renggli
> onComplete: worked, but onSuccess: did not.

They don't seem to want to fix this bug:

     http://dev.rubyonrails.org/ticket/5602
     http://dev.rubyonrails.org/ticket/2950

> (I removed the callback: as indicated in the method comment for onSuccess:)

The callback is required to display the new contents after the edit operation.

> However I do see a bug in the 'In Place Editor', whereby the second time
> that you edit,
> the text in the input field has collected some unwanted markup. I do not
> know if this is a current issue.

I can't reproduce that with the functional test. Can you provide a file-out?

Btw, Scriptaculous currently does not allow to specify multiple
handlers for the same event. So if you cascade two #onSuccess: only
the second one will be used.

Lukas

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