Hi Warner
I'm not quite sure whether I understand you setup completely.
Nevertheless two hints:

 - the "targets" attribute must refer to tapestry components. If you want to
refer to a client-side object use "elements".
 - The element you want to intercept indeed *must* be a DOM-node. You could
call an empty hook on some dom-element from your code or use dojo.connect if
you don't control the javascript code to intercept.

2008/5/11 Warner Onstine <[EMAIL PROTECTED]>:

> Hi all,
> I'm working on getting a Portal implementation working based off of this (
> http://blog.xilinus.com/2007/9/4/prototype-portal-class-2). So far I have
> everything working the way it should but am now getting to the stage where I
> want to start saving the portal layout changes to a db for the user. We're
> currently on 4.0.x and I spied the EventListener annotation and it looks
> like exactly what I need to call from the JavaScript side.
>
> The problem I'm running into is I don't know how to get my listener
> actions called, the javascript that is called is not tied to the DOM and I'm
> unclear on how I'm supposed to tie the function I want to listen to to a
> Tapestry component (as has been suggested in other emails).
>
> Here are the relevant pieces of code:
> portal_hooks.js (passed into the portal as function calls)
>
> function onChange(portalState) {
> }
>
> function onUpdate(portalState) {
> }
>
> @EventListener(targets="portal" events="onChange")
> public void testOnChange(BrowserEvent event) {
> }
>
> @EventListener(targets="portal" events="onUpdate")
> public void testOnChange(BrowserEvent event) {
> }
>
> the "portal" target is the actual JavaScript object that I'm creating in
> Portal.script in the "<initialization>" section:
> portal = new Xilinus.Portal("#portal div", {onOverWidget: onOverWidget,
> onOutWidget: onOutWidget, onChange: onChange, onUpdate: onUpdate,
> removeEffect: Effect.SwitchOff});
>
> So any suggestions on how to tie these together is greatly appreciated as
> the docs on this are not clear on how to do this except for the following
> line:
> "When listening to a client-side javascript function that does not
> represent a native browser-event, you can access the parameters passed to
> the function on the server-side. The Parameters are made available as a
> JSON-Array within the class BrowserEvent."
>
> but the example given doesn't work (at least I haven't gotten it to work
> for my case.
>
> Thanks in advance!
>
> -warner
>
> Warner Onstine - Programmer/Author
> New book on Tapestry 4!
> Tapestry 101 available at http://sourcebeat.com/books/tapestrylive.html
> [EMAIL PROTECTED]
> http://warneronstine.com/blog
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Marcus Schulte
http://marcus-schulte.blogspot.com

Reply via email to