I'm almost there.<br><br>I have a marker on the map which houses a link with an onclick handler called 'addLocation( "123456" );'. So, I tried to define addLocation like 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>This crashes my updater. It does pass the value of theId properly as this is stored into the MyLocation collection. But, it seems I need an html object renderer passed back to me. <br>
<br>Chris<br><br><br><div class="gmail_quote">On Wed, Jun 4, 2008 at 11:24 PM, 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">> When the user<br>
> clicks on the link it makes an Ajax call and adds to a collection on the<br>
> server.<br>
<br>
</div>Ok, if you don't want to update then simply use the AJAX requestor:<br>
<br>
(html request callback: [ coll add: 123 ])<br>
asJavascript<br>
<br>
This expression gives you a string that when evaluated by the<br>
Javascript engine triggers the execution of the Smalltalk block on the<br>
server.<br>
<br>
If you need to pass some data from the JavaScript world to the server<br>
you can use something like that:<br>
<br>
(html request<br>
callback: [ :v | coll add: v ]<br>
value: (SUStream on: 'navigator.appName'))<br>
asJavascript<br>
<br>
In this case the property navigator.appName is passed to the server.<br>
As far as I understand you want to pass some Google Maps data there.<br>
<div class="Ih2E3d"><br>
> I tried to use the code you provided in one method and I get:<br>
><br>
> MessageNotUnderstood: SUScript>>render:<br>
<br>
</div>I write most of the examples for the mailing-list directly in the<br>
mail-application, therefore there is usually some significant amount<br>
of fixing needed before usage. I only try to clear what the general<br>
approach is.<br>
<br>
For the example in the previous mail: Remove #asJavascript, the thing<br>
is already a string. SUScript in my Seaside 2.8 images understands<br>
#render:.<br>
<div class="Ih2E3d"><br>
> tried using #render:on: and didn't get much better results. Am I using an<br>
> out of date Scriptaculous package?<br>
<br>
</div>I don't know what platform and version you are on.<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>