google-code-export / mgwt

Automatically exported from code.google.com/p/mgwt
Other
1 stars 0 forks source link

LongtapEvent happens only once per component #234

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

LongtapEvent happens only once per component. On longtap event I can see the 
following stacktrace in gwt dev mod console:

com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, 
see full set in UmbrellaException#getCauses
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
    at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1359)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1315)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
    at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
    at java.lang.Thread.run(Thread.java:662)
Caused by: com.google.gwt.dev.shell.HostedModeException: Something other than 
an int was returned from JSNI method 
'@com.googlecode.mgwt.dom.client.event.touch.JsTouch::getIdentifier()': 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:247)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:75)
    at com.googlecode.mgwt.dom.client.event.touch.JsTouch$.getIdentifier$(JsTouch.java)
    at com.google.gwt.core.client.JavaScriptObject$.com_googlecode_mgwt_dom_client_event_touch_Touch_getIdentifier(JavaScriptObject.java)
    at com.googlecode.mgwt.dom.client.recognizer.longtap.LongTapRecognizer.onTouchMove(LongTapRecognizer.java:195)
    at com.googlecode.mgwt.dom.client.event.mouse.TouchMoveToMouseMoveHandler.onMouseMove(TouchMoveToMouseMoveHandler.java:53)
    at com.google.gwt.event.dom.client.MouseMoveEvent.dispatch(MouseMoveEvent.java:54)
    at com.google.gwt.event.dom.client.MouseMoveEvent.dispatch(MouseMoveEvent.java:1)
    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
    ... 30 more

Code example:

package client;

public class LongTapModule implements EntryPoint {

    public void onModuleLoad() {

        GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
            public void onUncaughtException(Throwable throwable) {
                throwable.printStackTrace();
            }
        });

        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
            @Override
            public void execute() {
                locateTestPanel();
            }
        });

    }

    private void locateTestPanel(){
        TouchPanel touchPanel = new TouchPanel();
        touchPanel.getElement().setInnerText("Touch panel");
        touchPanel.addLongTapHandler(new LongTapHandler() {
            public void onLongTap(LongTapEvent event) {
                Window.alert("Long tap event");
            }
        });
        RootPanel.get().add(touchPanel);
    }

}

LongTapModule.gwt.xml file:

<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0//EN"
        "http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-source/core/src/gwt-module.dtd">
<module>

    <inherits name='com.google.gwt.user.User'/>

    <entry-point class='client.LongTapModule'/>

    <inherits name="com.googlecode.mgwt.MGWT"/>

</module>

gwt version: 2.4
mgwt version: 2.1.1

Web browser used for dev.mode - Firefox, but this error also happens on mobile 
devices: ipad, iphone, android

Original issue reported on code.google.com by topolska...@gmail.com on 20 Aug 2012 at 4:43

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 419ffa19f435.

Original comment by kurka.da...@gmail.com on 28 Aug 2012 at 7:10

GoogleCodeExporter commented 9 years ago

Original comment by kurka.da...@gmail.com on 28 Aug 2012 at 7:10

GoogleCodeExporter commented 9 years ago

Original comment by kurka.da...@gmail.com on 20 Oct 2012 at 4:01

GoogleCodeExporter commented 9 years ago

Original comment by kurka.da...@gmail.com on 20 Oct 2012 at 4:11