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]