I've been playing with some code to register oncut against a GWT
TextBox. The basic event registration seems to be working ok; I get
to the event handler function, and the "return false" part seems to be
working as designed (the cut is blocked). The problem is that I'm
trying to call back from the event handler into a Java method ... but
it's never getting there. Am I doing something obviously stupid
here? The syntax looks right, and I'm not getting any errors. But
when I run this, I get the two alerts bracketing the attempt to call
from JavaScript to Java, but that method isn't getting invoked.
Here's my test code. I added this to the end of StockWatcher
onModuleLoad():
registerOnCut(nameField.getElement());
And added these functions:
public native void registerOnCut(Element element)
/*-{
element.oncut = function()
{
$wnd.alert("about to invoke Java doCut");
$entry([email protected]::doCut());
$wnd.alert("returned from Java doCut");
return false;
};
}-*/;
public void doCut()
{
Window.alert("made it to Java doCut");
}
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.