<div>Thanks Lukas,</div>
<div>&nbsp;</div>
<div>I made a working example, but i want to know if it is possible to simplify it.</div>
<div>&nbsp;</div>
<div>BTW the test result shows a good performance gain without the 100 callbacks.</div>
<div>&nbsp;</div>
<div>Render Time (with 100 callbacks) : 29 ms</div>
<div>
<div>Render Time (with 1 callback) : 6 ms</div>
<div>File Size (with 100 callbacks): 20736</div></div>
<div>File Size (with 1 callback):&nbsp;8611</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><font face="courier new,monospace">renderContentOn: html<br>&nbsp;html heading: &#39;Callback Test&#39;.</font></div>
<div><font face="courier new,monospace">&nbsp;html script: &#39;function showCell(cellid) {&#39;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((html updater id: &#39;result&#39;; callback: [:r | self renderResultOn: r];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callback: [:v | self result: v] value: (SUStream new nextPutAll: &#39;cellid&#39;))) printString, &#39;}&#39;.</font></div>

<div><br><font face="courier new,monospace">&nbsp;&nbsp;1 to: 100 do: [:idx | html anchor id: &#39;id_&#39;, idx asString;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;onClick: &#39;showCell(this.id)&#39;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with: idx. html space.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idx \\ 20 = 0 ifTrue: [html break]].</font></div>

<div><br><font face="courier new,monospace">&nbsp;html break.</font></div>
<div><font face="courier new,monospace">&nbsp;html div id: &#39;result&#39;; with: [self renderResultOn: html]</font></div>
<div>&nbsp;</div>
<div>br</div>
<div>Gerhard</div>
<div><br><br>&nbsp;</div>
<div class="gmail_quote">On Thu, May 1, 2008 at 10:53 AM, Lukas Renggli &lt;<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>&gt; wrote:<br>
<blockquote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid" class="gmail_quote">
<div class="Ih2E3d">&gt; What is the best way to avoid too many callbacks!<br><br></div>JavaScript.<br>
<div class="Ih2E3d"><br>&gt; I have a large table with e.g. 1000 cells.<br>&gt; Each cell has an onClick Event with a callback.<br>&gt; But to improve the performance, it would be<br>&gt; better to use only one callback which sends back the selected cell id as<br>
&gt; parameter!<br><br></div>You register single callback that passes an id of the selected cell to<br>the callback. Possibly the JsonParser I just submitted to the Seaside<br>repository might help you here to establish a simple protocol between<br>
the client and the server side.<br><br>Lukas<br><font color="#888888"><br>--<br>Lukas Renggli<br><a href="http://www.lukas-renggli.ch/" target="_blank">http://www.lukas-renggli.ch</a><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>
</font></blockquote></div><br>