From: SourceForge.net <no...@so...> - 2003-07-28 16:03:14
|
Bugs item #779007, was opened at 2003-07-28 18:03 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=779007&group_id=47038 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Alexei Goussev (gousseff) Assigned to: Nobody/Anonymous (nobody) Summary: window.open() cause javascript exception Initial Comment: I am runninig the following code now: >>> HtmlAnchor link = ... WebWindowListener windowEventListener = new WebWindowListener() { public void webWindowContentChanged (WebWindowEvent event) { log.warn("webWindowContentChanged called"); } public void webWindowOpened(WebWindowEvent event) { log.warn("webWindowOpened called"); } }; webClient.addWebWindowListener(windowEventListener); link.click(); <<< where link has the following on click attribute: onclick="javascript:var win = window.open ('','versionWindow','height=500,width=650,top='+ ((screen.height-(screen.height/1.618))-(500/2))+',left='+ ((screen.width-650)/2)+',scrollbars,resizable');win.focus ()" This code throws an Exception: what I see is: [WARN] MyTestClass - -webWindowOpened called E Time: 18,141 There was 1 error: 1) test1(MyTestClass)======= EXCEPTION START ======== EcmaError: lineNumber=[1] column=[0] lineSource= [GargoyleWrapper6()] name=[TypeError] sourceName= [Wrapper definition for onClick handler] message=[Cannot convert null to an object.] errorObject=[TypeError: Cannot convert null to an object.] com.gargoylesoftware.htmlunit.ScriptException: Cannot convert null to an object. at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngin e.execute(JavaScriptEngine.java:199) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJav aScriptIfPossible(HtmlPage.java:767) at com.gargoylesoftware.htmlunit.html.HtmlAnchor.click (HtmlAnchor.java:54) at MyTestClass.test1(MyTestClass.java:line where I call link.click()) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) Enclosed exception: TypeError: Cannot convert null to an object. (Wrapper definition for onClick handler; line 1) at org.mozilla.javascript.NativeGlobal.constructError (NativeGlobal.java:597) at org.mozilla.javascript.NativeGlobal.constructError (NativeGlobal.java:557) at org.mozilla.javascript.NativeGlobal.typeError0 (NativeGlobal.java:562) at org.mozilla.javascript.ScriptRuntime.toObject (ScriptRuntime.java:510) at org.mozilla.javascript.ScriptRuntime.toObject (ScriptRuntime.java:486) at org.mozilla.javascript.ScriptRuntime.getProp (ScriptRuntime.java:707) at org.mozilla.javascript.gen.c88.call(Wrapper definition for onClick handler:1) at org.mozilla.javascript.optimizer.OptRuntime.callSimple (OptRuntime.java:275) at org.mozilla.javascript.gen.c90.call(onClick handler:1) at org.mozilla.javascript.gen.c90.exec(onClick handler) at org.mozilla.javascript.Context.evaluateReader (Context.java:820) at org.mozilla.javascript.Context.evaluateString (Context.java:784) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngin e.execute(JavaScriptEngine.java:191) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJav aScriptIfPossible(HtmlPage.java:767) at com.gargoylesoftware.htmlunit.html.HtmlAnchor.click (HtmlAnchor.java:54) at MyTestClass.test1(MyTestClass.java:line where I call link.click()) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) == CALLING JAVASCRIPT == GargoyleWrapper6() ======= EXCEPTION END ======== Additional information (probably has nothing to do with the bug): the page that should appear in the new window contains 3 frames. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=779007&group_id=47038 |