[Seaside] Generating an URL for a callback
ke.sackey at gmail.com
Wed Jun 11 11:00:47 UTC 2008
I've had the same problem before. The following code should work for
returning the URL for a callback block:
>> callbackUrlFor: aBlock on: html
| updater callbackKey url |
updater := html updater callback: aBlock.
callbackKey := html callbacks registerAjaxCallback: [updater process].
url := html context actionUrl withParameter: callbackKey.
Then you can use it in your render like this....
>> renderContentOn: html
| callbackUrl |
callbackUrl := self callbackUrlFor: [:r | r text: 'Example!' ] on: html.
html anchor class: 'jTip'; id: 'element-id'; url: callbackUrl; with: 'Mouse
over for tooltip'.
> I'm porting an app to seaside that is using jTip
> (http://www.codylindley.com/blogstuff/js/jtip/) to handle tooltips.
> jTip works on links like the one below
> <a id="element-id" class="jTip" href="/callback-url?width=450">Mouse
> over for tooltip</a>
> where callback-url will return the html to render as the tooltip. How
> do I generate the callback-url?
> Searching the archives, the closest I could find was a snippet like:
> html updater
> callback: [ :r | r render: 'bar' ];
> However, this just evaluates to http://localhost:8080/seaside/myapp
> Any help would be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside