<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
</head><body>
<p> </p>
<p style="margin: 0;"><span><span></span>Paul,</span></p>
<p style="margin: 0;"><span> </span></p>
<p style="margin: 0px; "><span>thanks for answering. </span></p>
<p><span> </span></p>
<p><span>Unfortunately, it doesn't work for me. It leaves me with a blank page on Chrome and a text-only page containing teh html of the complete page re-rendered.  Even if I replace the jQuery this with the concrete ID of my list, it doesn't work. </span></p>
<p> </p>
<p>Wouldn't a POST request reload the whole page anyways?   </p>
<p> </p>
<p>Joachim </p>
<p style="margin: 0px; "> </p>
<p style="margin: 0px; "></p>
<div style="margin: 5px 0px 5px 0px;">
<br/>Paul DeBruicker <pdebruic@gmail.com> hat am 19. Juli 2012 um 17:11 geschrieben:
<br/>
<br/>> Hi Joachim,
<br/>>
<br/>> I do it like this:
<br/>>
<br/>>         (html jQuery post
<br/>>                 confirm: 'Do you really want to delete this object?';
<br/>>                 script: [ :s |
<br/>>                                 self deleteObject: obj.
<br/>>                                 s << s jQuery this load html: [:t | self renderListOn: t] ]);
<br/>>         
<br/>>
<br/>> The #script: is a script rendering callback that only gets run if the
<br/>> confirm is confirmed (accepted?).  You might have to change the send of
<br/>> #this to the specific #id you mean to load into.
<br/>>
<br/>> But I'm not sure if its the best way.  And would love to learn how to
<br/>> make it better/safer if there are obvious errors.
<br/>>
<br/>>
<br/>>
<br/>> Good luck
<br/>>
<br/>> Paul
<br/>>
<br/>>
<br/>>
<br/>>
<br/>>
<br/>>
<br/>>
<br/>> On 07/19/2012 05:21 AM, jtuchel wrote:
<br/>> > Funnily, the code Seaside generates looks as if it does what I want:
<br/>> >
<br/>> > if(confirm("Do you really want to delete this object?"))
<br/>> > {
<br/>> >         $.ajax({
<br/>> >                 "url":"/MyApp",
<br/>> >
<br/>> > "data":["_s=XON7moFvT7ejEWMY","_k=OBzPflVTFHdzvNyy","20"].join("&"),
<br/>> >                 "complete":function(){
<br/>> >                 
<br/>> > $(this).load("/MyApp",["_s=XON7moFvT7ejEWMY","_k=OBzPflVTFHdzvNyy","21"].join("&"))
<br/>> >                         }
<br/>> >                 })
<br/>> > }
<br/>> >
<br/>> > I read this as if user clicks OK, call the ajax callback which deletes on
<br/>> > the server side, and when that is complete, load the contents of the list
<br/>> > again and have it rendered by the server.
<br/>> >
<br/>> > So maybe I am not really hunting for the complete event, but what else?
<br/>> > Or is it so that the ajax call to a server side callback does not wait for
<br/>> > the server side to finish? Does Seaside return an HTTP response immediately?
<br/>> > If so, what tricks are there to wait for the server to finish deleting and
<br/>> > redraw after that?
<br/>> >
<br/>> > Thanks for reading
<br/>> >
<br/>> > Joachim
<br/>> >
<br/>> > --
<br/>> > View this message in context: http://forum.world.st/Jquery-Ajax-confirm-callback-problem-tp4640695p4640697.html
<br/>> > Sent from the Seaside General mailing list archive at Nabble.com.
<br/>> > _______________________________________________
<br/>> > seaside mailing list
<br/>> > seaside@lists.squeakfoundation.org
<br/>> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
<br/>> >
<br/>>
<br/>> _______________________________________________
<br/>> seaside mailing list
<br/>> seaside@lists.squeakfoundation.org
<br/>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
</div>
</body></html>