<html><head></head><body bgcolor="#FFFFFF"><div>I think you want to change as follows:</div><div><br></div><div>post -&gt; ajax</div><div>jQuery this -&gt; jQuery id: someId</div><div>load html: -&gt; replaceWith:</div><div>&amp; properly parenthesize such that: s &lt;&lt; (...)<br><br><div>I'll try to remember posting a complete answer when I get back as well.&nbsp;</div><div><br></div>Johan (sent from my mobile)</div><div><br>On 20 Jul 2012, at 14:38, John McKeon &lt;<a href="mailto:p3anoman@gmail.com">p3anoman@gmail.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div>I would try moving the code from the callback: block into the load html: block but leave everything else the same as&nbsp;in the original code.<br><br>
<div class="gmail_quote">On Fri, Jul 20, 2012 at 2:22 AM, Joachim Tuchel (objektfabrik) <span dir="ltr">&lt;<a href="mailto:jtuchel@objektfabrik.de" target="_blank">jtuchel@objektfabrik.de</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote"><u></u>
<div>
<p>&nbsp;</p>
<p style="MARGIN:0px"><span><span></span>Paul,</span></p>
<p style="MARGIN:0px"><span>&nbsp;</span></p>
<p style="MARGIN:0px"><span>thanks for answering. </span></p>
<p><span>&nbsp;</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.&nbsp; Even if I replace the jQuery this with the concrete ID of my list, it doesn't work.&nbsp;</span></p>

<p>&nbsp;</p>
<p>Wouldn't a POST request reload the whole page anyways?&nbsp; &nbsp;</p>
<p>&nbsp;</p>
<p>Joachim&nbsp;</p>
<p style="MARGIN:0px">&nbsp;</p>
<p style="MARGIN:0px"></p>
<div style="MARGIN:5px 0px"><br>Paul DeBruicker &lt;<a href="mailto:pdebruic@gmail.com" target="_blank">pdebruic@gmail.com</a>&gt; hat am 19. Juli 2012 um 17:11 geschrieben: <br><br>&gt; Hi Joachim, <br>&gt; <br>&gt; I do it like this: <br>
&gt; <br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(html jQuery post <br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;confirm: 'Do you really want to delete this object?'; <br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;script: [ :s | <br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self deleteObject: obj. <br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s &lt;&lt; s jQuery this load html: [:t | self renderListOn: t] ]); <br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&gt; <br>&gt; The #script: is a script rendering callback that only gets run if the <br>&gt; confirm is confirmed (accepted?).&nbsp; You might have to change the send of <br>
&gt; #this to the specific #id you mean to load into. <br>&gt; <br>&gt; But I'm not sure if its the best way.&nbsp; And would love to learn how to <br>&gt; make it better/safer if there are obvious errors. <br>&gt; <br>&gt; <br>
&gt; <br>&gt; Good luck <br>&gt; <br>&gt; Paul <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; On 07/19/2012 05:21 AM, jtuchel wrote: <br>&gt; &gt; Funnily, the code Seaside generates looks as if it does what I want: <br>
&gt; &gt; <br>&gt; &gt; if(confirm("Do you really want to delete this object?")) <br>&gt; &gt; { <br>&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$.ajax({ <br>&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"url":"/MyApp", <br>&gt; &gt; <br>
&gt; &gt; "data":["_s=XON7moFvT7ejEWMY","_k=OBzPflVTFHdzvNyy","20"].join("&amp;"), <br>&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"complete":function(){ <br>&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
&gt; &gt; $(this).load("/MyApp",["_s=XON7moFvT7ejEWMY","_k=OBzPflVTFHdzvNyy","21"].join("&amp;")) <br>&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} <br>&gt; &gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}) <br>
&gt; &gt; } <br>&gt; &gt; <br>&gt; &gt; I read this as if user clicks OK, call the ajax callback which deletes on <br>&gt; &gt; the server side, and when that is complete, load the contents of the list <br>&gt; &gt; again and have it rendered by the server. <br>
&gt; &gt; <br>&gt; &gt; So maybe I am not really hunting for the complete event, but what else? <br>&gt; &gt; Or is it so that the ajax call to a server side callback does not wait for <br>&gt; &gt; the server side to finish? Does Seaside return an HTTP response immediately? <br>
&gt; &gt; If so, what tricks are there to wait for the server to finish deleting and <br>&gt; &gt; redraw after that? <br>&gt; &gt; <br>&gt; &gt; Thanks for reading <br>&gt; &gt; <br>&gt; &gt; Joachim <br>&gt; &gt; <br>&gt; &gt; -- <br>
&gt; &gt; View this message in context: <a href="http://forum.world.st/Jquery-Ajax-confirm-callback-problem-tp4640695p4640697.html" target="_blank">http://forum.world.st/Jquery-Ajax-confirm-callback-problem-tp4640695p4640697.html</a> <br>
&gt; &gt; Sent from the Seaside General mailing list archive at <a href="http://Nabble.com">Nabble.com</a>. <br>&gt; &gt; _______________________________________________ <br>&gt; &gt; seaside mailing list <br>&gt; &gt; <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a> <br>
&gt; &gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a> <br>&gt; &gt; <br>&gt; <br>&gt; _______________________________________________ <br>
&gt; seaside mailing list <br>&gt; <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a> <br>&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a> </div>
</div><br>_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>seaside mailing list</span><br><span><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a></span><br><span><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a></span><br></div></blockquote></body></html>