Lukas,<br><br>Thank you. I got it working. I will definitely read further in the documentation. <br><br>Ah, coding in Seaside is like going from painting with blocks of wood to creating a Mona Lisa. Seaside code is pure art.<br>
<br>Chris<br><br><div class="gmail_quote">On Thu, Jun 5, 2008 at 2:05 AM, Lukas Renggli <<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">> I have a marker on the map which houses a link with an onclick handler<br>
> called 'addLocation( "123456" );'. So, I tried to define addLocation like<br>
> this:<br>
><br>
> html script: (' function addLocation( theId ) { ', ((<br>
> html updater<br>
> id: 'locations';<br>
> callback: [ :v |<br>
> locations add: ( myLocation new title: v ).<br>
> self renderLocationsOn: html.<br>
> ]<br>
> value: (SUStream on: 'theId')) asJavascript ), '; }'<br>
> ).<br>
> ]<br>
> ]<br>
><br>
> This crashes my updater. It does pass the value of theId properly as this<br>
> is stored into the MyLocation collection. But, it seems I need an html<br>
> object renderer passed back to me.<br>
<br>
</div>You should not render within #callback:value:. Use a<br>
rendering-callback to update your page.<br>
<br>
Furthermore, pay attention that 'html' is not valid anymore (this html<br>
stream has been sent out when the script was generated) when the<br>
callback is triggered. Use the renderer that gets passed into the<br>
render-callback. Slime detects that kind of problems.<br>
<br>
html updater<br>
id: 'locations';<br>
callback: [ :v | locations add: v ] value: 'something';<br>
callback: [ :r | self renderLocationsOn: r ].<br>
<br>
Please check out the class comments in SUAjax and subclasses. Also the<br>
methods #callback:value: and #callback: are heavily documented.<br>
<div><div></div><div class="Wj3C7c"><br>
Cheers,<br>
Lukas<br>
<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>
</div></div></blockquote></div><br>