<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 23, 2013 at 12:27 PM, Johan Brichau <span dir="ltr">&lt;<a href="mailto:johan@inceptive.be" target="_blank" class="vt-p">johan@inceptive.be</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im"><br>
On 23 Dec 2013, at 14:15, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com" class="vt-p">marianopeck@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Indeed, it seems I need this because even if I render only the table, the scroll goes up again to the top of the table....<br>
<br>
</div>Do you replace the table or only its inner html?</blockquote><div><br></div><div>I was replacing a div which is a container of the table. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
 In general, to keep the scroll position of an element, you must replace its contents (and not the element itself).<br>
Perhaps in case of a table, you may only re-render the &lt;tbody&gt;, and then also only replacing its inner html.<br>
<div class="im"><br></div></blockquote><div><br></div><div>Ok, I will try that.  </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">
&gt; So..which other solution you found besides explicit id per row? Of course in the server it is easy to know which row to render, the problem is how to know it in client side.<br>
&gt; I am would be glad you listen your approaches here.<br>
<br>
</div>You want to replace the row where the user clicked in, right?<br></blockquote><div><br></div><div>Yes. I just need to re-render it so that since it is selected now, it has a different css. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

The $(this) will refer to the checkbox element you clicked, but not anymore in the response script. So, you need to capture it in a lexical scope.<br>
<br></blockquote><div><br></div><div>ahaaaa, good point!</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

This is what I would try:<br>
<br>
 onClick:  (((JSStream on: &#39;var myself = this&#39;),<br>
                (html jQuery ajax<br>
                          serializeThisWithHidden;<br>
                          script: [ :s | s &lt;&lt; (((s jQuery expression:(JSStream on: &#39;myself&#39;)) closest: &#39;tr&#39;) html: self report) ])) asFunction apply: #());<br>
<br>
The idea is to generate this:<br>
<br>
onclick = &quot;(function(){ var myself = this; &lt;&lt;ajax call&gt;&gt; })()&quot;<br>
<br>
The above might or might not work because I did not try it. But something along those lines should work...<br>
<span class=""><font color="#888888"><br></font></span></blockquote><div><br></div><div>mmmm this is what get&#39;s generated:</div><div><br></div><div>function(){var myself = this;jQuery.ajax({&quot;url&quot;:&quot;/MyApp&quot;,&quot;data&quot;:[&quot;_s=w9GmvDOQpAp_pp0c&quot;,&quot;_k=-3MfxH3kyGWxn6Vi&quot;,&quot;96&quot;,jQuery(this).next(&quot;input:hidden&quot;).andSelf().serialize()].join(&quot;&amp;&quot;),&quot;dataType&quot;:&quot;script&quot;})}()<br>
</div><div><br></div><div>I don&#39;t see &#39;myself&#39; used it later....</div><div><br></div><div>BTW, in your example you do: &quot;html: self report&quot;. but...since in this case I am re-rendering the row only (and not the whole table/report), I should only re-render the row right?   so I should do something like instead:</div>
<div><br></div><div>self renderRowOfObject: anObject with: html   ? </div><div><br></div><div>and there write the row</div><div><br></div><div>Thanks for you help Johan. </div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><font color="#888888">
Johan_______________________________________________<br>
</font></span><div class=""><div class="h5">seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" class="vt-p">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="vt-p">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
</div></div>