Hi group,
I use the following code to insert something via AJAX, but I have to trigger a alert("insertion complete") if the insertion is completed. How can I do this? There are no Event Handler here - right? html evaluator triggerFormElement: myElement; callback: [ :script | script insertion top id: #xyz; with: [ :r| r text 'TOP']. script insertion bottom; id: #xyz; with: [ :r| r text 'BOTTOM']. ] . salute Thomas |
html evaluator
triggerFormElement: myElement; callback: [ :script | script insertion top id: #xyz; with: [ :r| r text 'TOP']. script insertion bottom; id: #xyz; with: [ :r| r text 'BOTTOM']. script alert: 'Insertion complete' ] Regards, John www.pinesoft.co.uk Thomas Fischer wrote: > Hi group, > I use the following code to insert something via AJAX, but I have > to trigger a alert("insertion complete") if the insertion is completed. > How can I do this? There are no Event Handler here - right? > > > html evaluator > triggerFormElement: myElement; > callback: [ :script | > script insertion top id: #xyz; with: [ :r| r text 'TOP']. > script insertion bottom; id: #xyz; with: [ :r| r text 'BOTTOM']. > ] > . > > salute > Thomas Pinesoft Computers are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
> html evaluator
> triggerFormElement: myElement; > callback: [ :script | > script insertion top id: #xyz; with: [ :r| r text 'TOP']. > script insertion bottom; id: #xyz; with: [ :r| r text 'BOTTOM']. > script alert: 'Insertion complete' > ] Yes, that's the solution. Most JavaScript code is not asynchron and is evaluated from top top bottom. The exceptions are the AJAX request/updater/evaluator's that tigger a HTTP request in the background while the JavaScript evaluation immediately continues (it normally doesn't wait to complete). That's why you only need an event in those cases. Lukas -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Thomas Fischer
Hi thomas,
I saw Jhon answer your question but I wanted to add questioning about the real need to use insertion at all. I use to update the whole component even if I had to insert or modify 1 row mostly because is more simple to do it and almost allways a more complete solution to the problem. just my 2 cents Sebastian > -----Mensaje original----- > De: [hidden email] > [mailto:[hidden email]] En nombre > de Thomas Fischer > Enviado el: Jueves, 04 de Octubre de 2007 06:15 > Para: [hidden email] > Asunto: [Seaside] AJAX Evaluator and Event Handler > > > Hi group, > I use the following code to insert something via AJAX, but I have > to trigger a alert("insertion complete") if the insertion > is completed. > How can I do this? There are no Event Handler here - right? > > > html evaluator > triggerFormElement: myElement; > callback: [ :script | > script insertion top id: #xyz; with: [ :r| r text 'TOP']. > script insertion bottom; id: #xyz; with: [ :r| r text 'BOTTOM']. > ] > . > > salute > Thomas > -- > View this message in context: > http://www.nabble.com/AJAX-Evaluator-and-Event-Handler-tf45667 > Sent from the Squeak - Seaside mailing list archive at Nabble.com. > > _______________________________________________ > 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 |
In reply to this post by John Thornborrow
John Thornborrow wrote:
> callback: [ :script | > script insertion top id: #xyz; with: [ :r| r text 'TOP']. > script insertion bottom; id: #xyz; with: [ :r| r text 'BOTTOM']. > script alert: 'Insertion complete' > ] Thanks for your answers! In fact I need not a simple alert but some JS code, so I use now: script insertion top id: locationsId; with: [ :r | r text: 'TOP' ] script add: (SUStream on: ' some JavaScript Code ') salute Thomas |
Take a look if #text: is a deprecated message. Modern canvas uses #render:
Sebastian Sastre > -----Mensaje original----- > De: [hidden email] > [mailto:[hidden email]] En nombre > de Thomas Fischer > Enviado el: Jueves, 04 de Octubre de 2007 12:38 > Para: [hidden email] > Asunto: Re: [Seaside] AJAX Evaluator and Event Handler > > > John Thornborrow wrote: > > callback: [ :script | > > script insertion top id: #xyz; with: [ :r| r text 'TOP']. > > script insertion bottom; id: #xyz; with: [ :r| r text 'BOTTOM']. > > script alert: 'Insertion complete' > > ] > > Thanks for your answers! > In fact I need not a simple alert but some JS code, so I use now: > > script insertion top id: locationsId; with: [ :r | r text: 'TOP' ] > script add: (SUStream on: ' some JavaScript Code ') > > salute > Thomas > -- > View this message in context: > http://www.nabble.com/AJAX-Evaluator-and-Event-Handler-tf45667 > Sent from the Squeak - Seaside mailing list archive at Nabble.com. > > _______________________________________________ > 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 |
> Take a look if #text: is a deprecated message. Modern canvas
> uses #render: > > Sebastian Sastre #text: is not deprecated for rendering text directly off the canvas, only for what should be #with: on things like buttons and anchors. Object renderOn: is implemented as renderOn: aRenderer aRenderer text: self So #text: is perfectly valid the way he was using it. Ramon Leon http://onsmalltalk.com _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |