sabihi / gwt-phonegap

Automatically exported from code.google.com/p/gwt-phonegap
0 stars 0 forks source link

InAppBrowser handlers problems #68

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
in this example im trying to get the handlers to notify me when the load is 
complete and when the browser is being exit.
none of them work.
InAppBrowserReference ref = inAppBrowser.open("http://www.google.de", "", "");

    ref.addExitHandler(new ExitHandler() {

        @Override
        public void onExit(ExitEvent event) {
            Window.alert("hi");
            System.out.println("blaaaaaa");
        }
    });

    ref.addLoadStopHandler(new LoadStopHandler() {

        @Override
        public void onLoadStop(LoadStopEvent event) {
            Window.alert("JFC!");

        }
    });

Original issue reported on code.google.com by ckCarn...@gmail.com on 24 Apr 2013 at 10:02

GoogleCodeExporter commented 8 years ago
I wrote a fix for that. Please checkout the last stuff from repository and 
apply these patch to it.

Original comment by ronny.bu...@gmail.com on 13 Jun 2013 at 7:21

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision f9d8a4d5f553.

Original comment by kurka.da...@gmail.com on 6 Jul 2013 at 7:00

GoogleCodeExporter commented 8 years ago

Original comment by kurka.da...@gmail.com on 6 Jul 2013 at 7:00

GoogleCodeExporter commented 8 years ago
Downloaded the latest branch with the patch and it keeps throwing a Type error 
when trying to associate a handler. Here's the code:

  browser = phoneGap.getInAppBrowser().open("http://cnn.com", "", "");
            if (browser != null) {
                browser.addExitHandler(new ExitHandler() {
                    @Override
                    public void onExit(ExitEvent event) {
                       Window.alert("hi");
                    }
                });
            }

SEVERE: Exception caught: (TypeError) 
 stack: com_googlecode_gwtphonegap_client_inappbrowser_InAppBrowserReferenceBaseImpl_$addExitHandler__Lcom_googlecode_gwtphonegap_client_inappbrowser_InAppBrowserReferenceBaseImpl_2Lcom_googlecode_gwtphonegap_client_inappbrowser_ExitHandler_2Lcom_google_web_bindery_event_shared_HandlerRegistration_2

Original comment by jve...@gmail.com on 10 Aug 2013 at 9:38

GoogleCodeExporter commented 8 years ago
This patch was not applied properly as InAppBrowserReferenceBaseImpl.java is 
missing most ensureHandlers(); 

Original comment by jve...@gmail.com on 12 Sep 2013 at 8:54

GoogleCodeExporter commented 8 years ago
Verified on gwtphonegap 3.5 and this issue seems to be resolved. 

Original comment by svkirans@gmail.com on 30 Jun 2014 at 5:39