OK, From what I have since found out is that *all* the native browser
events are stored in a JSNI method in the DOMImpl class here
DOMImpl.eventGetTypeInt(String name)... which is why the exception was
being thrown (there is no "drop", "dragenter", etc events defined).

So in order to add the new html5 events I would need to add my own
DOMImpl class... which I can't seem to do... I appear to be trying to
accomplish the same task as the person posting here
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/560ff832885745b0#

This doesn't appear to be possible (or at least simple or obvious or
documented)...

Its frustrating for me as I've already written the (few lines of)
javascript code to do this - I'm using GWT for a project so really I
need a GWT implementation...

Do any of the GWT experts have any suggestions??

On Dec 30, 4:24 pm, DaveC <david.andrew.chap...@googlemail.com> wrote:
> I'm probably not doing this the right way but, I've been trying to
> extend MouseEvent to support HTML5 Drag and Drop (drag, dragenter,
> etc. etc.).
>
> I've created a:
>
> Has...Handlers interface
> bunch of Handler classes (DropHandler, DragEnterHandler, etc)
> and a bunch of Event classes that extend MouseEvent (DropEvent,
> DragEnterEvent, etc).
>
> I've also created a DropTarget Widget that implements the
> Has...Handlers interface which accepts a Widget as a param in its
> contructor which then calls setElement() passing in widget.getElement
> ()...
>
> I then add this DropTarget to the RootPanel (for testing purposes) in
> an onModuleLoad.
>
> But I'm getting a low level error ("Something other than an int was
> returned from JSNI method"):
>
> com.google.gwt.dev.shell.HostedModeException: Something other than an
> int was returned from JSNI method
> '....@com.google.gwt.user.client.impl.domimpl::eventGetTypeInt(Ljava/lang/
> String;)': JS value of type undefined, expected int
>     at com.google.gwt.dev.shell.JsValueGlue.getIntRange
> (JsValueGlue.java:266)
>     at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
>     at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt
> (ModuleSpace.java:242)
>     at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt
> (JavaScriptHost.java:75)
>     at com.google.gwt.user.client.impl.DOMImpl.eventGetTypeInt
> (DOMImpl.java)
>     at com.google.gwt.user.client.Event$.getTypeInt(Event.java:491)
>     at com.google.gwt.user.client.ui.Widget.addDomHandler(Widget.java:
> 184)
>     at
> com.applegreen.gwt.html5.dnd.client.DropTarget.addDragEnterHandler
> (DropTarget.java:44)
>     at com.applegreen.gwt.test.client.DragAndDropTest.onModuleLoad
> (DragAndDropTest.java:46)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>     at java.lang.reflect.Method.invoke(Unknown Source)
>     at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:
> 369)
>     at com.google.gwt.dev.shell.OophmSessionHandler.loadModule
> (OophmSessionHandler.java:185)
>     at com.google.gwt.dev.shell.BrowserChannelServer.processConnection
> (BrowserChannelServer.java:380)
>     at com.google.gwt.dev.shell.BrowserChannelServer.run
> (BrowserChannelServer.java:222)
>     at java.lang.Thread.run(Unknown Source)
>
> Can anyone shed any light on what I'm doing wrong or what method I
> should have overidden (I'm not a java programmer btw)??
>
> Cheers,
> Dave

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to