You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Gabriel Lozano <gh...@gmail.com> on 2006/11/07 04:20:50 UTC
Problems with Event listener
Hi
I'm trying to work with the eventListener but I just can't get just the
example to work. I have a page with the same code as the "Big brother is
watching you" example in the tapestry page. the html I have is this:
<span jwcid="$content$">
<span jwcid="@Shell" title="Test" debugEnabled="true"
debugContainerId="dojoDebug">
<body jwcid="@Body">
<div id="myFavoriteDiv">Big brother is watching you.</div>
</body>
</span>
</span>
and the .java this:
import org.apache.tapestry.annotations.EventListener;
import org.apache.tapestry.event.BrowserEvent;
import org.apache.tapestry.event.PageEvent;
import org.apache.tapestry.html.BasePage;
public abstract class Test extends BasePage {
@EventListener(elements = "myFavoriteDiv", events = "onmouseover")
public void watchText(BrowserEvent event)
{
// do something
System.out.println("User clicked on x/y coordinates "
+ event.getPageX() + "/" + event.getPageY());
}
}
But nothing happends. But if I give a pageBeginRenderListener it gets
called. What am I doing wrong or what else should I do to get this working?
Any help is very appreciated.
Thanks in advanced.
Gabriel H. Lozano M.