[Seaside] Render into a separate document while sharing context

Norbert Hartl norbert at hartl.name
Thu May 17 09:32:24 UTC 2012


Am 16.05.2012 um 20:50 schrieb Paul DeBruicker:

> On 05/16/2012 09:16 AM, Norbert Hartl wrote:
>> To place a marker I need to call some javascript function. That function takes latitude, longitude and a definition of a window that pops up if the marker is pressed. The popup window needs to contain an html anchor. Therefor I need to add the callbacks to the current renderer.
>> 
>> Is there something that assists in doing this. WABuilder would be fine but it creates a new render context.
>> 
>> thanks,
>> 
>> Norbert____
> 
> 
> Could you do something like what I suggested in the Zinc Callback Limit thread a few days ago?
> 
> http://forum.world.st/Zinc-Callback-Limit-tp4630181p4630195.html

I don't think so. You are tunneling virtual callbacks over one real callback. But that one real callback you need to draw in this canvas. My problem is the place where the rendered string should be drawn. Basically I have

...
   "this is anchor1"
   html anchor
	onClick: (html jQuery ajax ...)
        with: 'foo'.
   html script: (JSStream on: '

      var aMarker = new google.maps.Marker({
         position: new google.maps.LatLng(marker.lat, marker.lon),
         map: map
      }); 
      google.maps.event.addListener(aMarker, "click", clickedMarker);
      aMarker.info = new google.maps.InfoWindow({
         content: '<a href="...">foo</a>'
      }); '.
...

So I have anchor1 that is rendered on the canvas. Then I need to render a script on that canvas that creates a marker on a map. If you look at the "content: '<a..." there I need to render anchor1 (or similar) again. So it is perfect if the anchor registers its callback but then I need the string presentation of that link in order to be able to add it to the javascript stream. I have the impression that the solution is quite easy and I'm just missing a link.

Norbert




More information about the seaside mailing list