<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Ciao,&nbsp;<div><br><div>with the Ryan changes all works fine.</div><div><br></div><div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Dario,</div>
<div>I think the trouble is that when you have two or more ajax scripts to be run you are not guaranteed which will run first. If you use a callback and send serializeThis to the ajax object, it runs before any scripts:</div>

<div>&nbsp;</div>
<div>html anchor</div>
<div>&nbsp;&nbsp; callback: [ self setIndex: aValue ];</div>
<div>&nbsp;&nbsp; onClick: (html jQuery ajax</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serializeThis;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; script: [ :s |&nbsp;(s jquery: anId) html: [ :h | self renderStuffOn: h ].</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s &lt;&lt; (s jQuery: anId2) html: [ :h | self renderSomeOtherStuffOn: h ]&nbsp;]...<br></div></blockquote><div><br></div><div>I think the use of callback is more clear but some test id do don't solve the problematic.</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span></div><div>At the top of my rendering i have this code :</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                 html document addLoadScript: (html jQuery ajaxSetup
                                onError: (html javascript
                                  alert: 'The session erase a jq error.'</span><span class="Apple-style-span" style="white-space: pre;">&nbsp;))</span><br></div><div><span class="Apple-style-span" style="white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="white-space: pre;">and when i work with callback the system erase the alert.</span></div><div><span class="Apple-style-span" style="white-space: pre; "><br></span></div><div><span class="Apple-style-span" style="white-space: pre; ">How i  can use the callback  in this problematic, or the Ryan indications is the only solution.</span></div><div><span class="Apple-style-span" style="white-space: pre; "><br></span></div><div><span class="Apple-style-span" style="white-space: pre; "><span class="Apple-tab-span" style="white-space:pre">        </span>Thanks,</span></div><div><span class="Apple-style-span" style="white-space: pre; "><br></span></div><div><span class="Apple-style-span" style="white-space: pre; "><span class="Apple-tab-span" style="white-space:pre">                </span>Dario</span></div><div><br></div><blockquote type="cite">
<div>Regards,</div>
<div>John<br></div>
<div class="gmail_quote">On Wed, Jun 5, 2013 at 4:40 AM, <span dir="ltr">&lt;<a href="mailto:dtrussardi@tiscali.it" target="_blank">dtrussardi@tiscali.it</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
<div style="WORD-WRAP:break-word">
<div>Ciao,</div>
<div><br></div>
<div>i have &nbsp;a anchor based on this code:</div>
<div><span style="WHITE-SPACE:pre-wrap"></span></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>html anchor</div>
<div><span style="WHITE-SPACE:pre-wrap"></span>script: (html jQuery this button</div>
<div><span style="WHITE-SPACE:pre-wrap"></span>text: true;</div>
<div><span style="WHITE-SPACE:pre-wrap"></span>primaryIcon: &nbsp;'ui-icon-circle-plus'</div>
<div><span style="WHITE-SPACE:pre-wrap"></span>title: 'Successivo');</div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>onClick: (html jQuery ajax</div>
<div><span style="WHITE-SPACE:pre-wrap"></span><span style="WHITE-SPACE:pre-wrap"></span>( html jQuery ajax&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="WHITE-SPACE:pre-wrap"></span>script: [ :s | <span style="WHITE-SPACE:pre-wrap"></span>s &lt;&lt; (s jQuery: &nbsp;#'base') load html:[:h|<b> <span style="WHITE-SPACE:pre-wrap"></span>"A"<span style="WHITE-SPACE:pre-wrap"> </span>self incrementaIndex: true.</b>&nbsp;</div>

<div><span style="WHITE-SPACE:pre-wrap"></span>"B1"<span style="WHITE-SPACE:pre-wrap"> </span><span style="WHITE-SPACE:pre-wrap"></span>(self renderingBaseOn: &nbsp;h)].<span style="WHITE-SPACE:pre-wrap"> </span></div>

<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span><span style="WHITE-SPACE:pre-wrap"></span>s &lt;&lt; (s jQuery: #'orarioRiferimento') load html:[:h| <span style="WHITE-SPACE:pre-wrap"></span>&nbsp;"B2"<span style="WHITE-SPACE:pre-wrap"> </span>( self renderOrarioRiferimentoOn: h)]]);<span style="WHITE-SPACE:pre-wrap"> </span></div>

<div><span style="WHITE-SPACE:pre-wrap"></span>with: '&gt;'.</div>
<div><br></div>
<div><br></div>
<div>My objective when a user click on this anchor is:</div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>A)&nbsp;<span style="WHITE-SPACE:pre-wrap"> </span>&nbsp;update a index &nbsp;with the&nbsp;&nbsp;<span style="WHITE-SPACE:pre-wrap"> </span><b>self incrementaIndex: true.</b></div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>B1)&nbsp;<span style="WHITE-SPACE:pre-wrap"> </span>update the div #base with:<span style="WHITE-SPACE:pre-wrap"> </span>&nbsp;<span style="WHITE-SPACE:pre-wrap"> </span>&nbsp;self renderingBaseOn: h</div>

<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>B2) update the div #orarioRiferimento&nbsp;<span style="WHITE-SPACE:pre-wrap"> </span>with:<span style="WHITE-SPACE:pre-wrap"> </span>&nbsp;self renderOrarioRiferimentoOn: h</div>
<div><br></div>
<div><br></div>
<div>Where the B1 - B2 &nbsp;rendering is based on the index state.</div>
<div><br></div>
<div>Now i have a&nbsp;strange behavior because sometime the B2<span style="WHITE-SPACE:pre-wrap"> </span>&nbsp;div #orarioRiferimento<span style="WHITE-SPACE:pre-wrap"> </span>&nbsp;renderings is not aligned to the index.</div>
<div><br></div>
<div>As if the onClick script action &nbsp;is not execute&nbsp;in the&nbsp;definition&nbsp;sequence.</div>
<div><br></div>
<div><br></div>
<div>Any suggestions ?</div>
<div><br></div>
<div>What is the right definition to solve this problematic type ?</div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>Thanks,</div>
<div><br></div>
<div><span style="WHITE-SPACE:pre-wrap"></span>Dario</div>
<div><br></div>
<div><br></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><br clear="all"><br>-- <br><a href="http://jmck.seasidehosting.st/" target="_blank">jmck.seasidehosting.st</a> 
_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br></blockquote></div><br></div></body></html>