Yet another Javacript exception

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Yet another Javacript exception

Ritesh Trivedi
Here is the excerpt from the HTML page

.........
LogicalHostArray[122]=a122;

a123 = new Array();

a123[0] = new Option("pgwhost", "pgwhost", true, true);

LogicalHostArray[123]=a123;

function SetLogicalHosts(){

//alert("options.length="+document.theForm.logicalHosts.options.length);
        var rr = LogicalHostArray[document.theForm.eventType.selectedIndex];
        //alert("selectedIndex="+document.theForm.eventType.selectedIndex);
        //alert("rr="+rr[i].text);
        for(i = 0; i < rr.length; ++i) {
                document.theForm.logicalHosts.options[i] = rr[i];
        }
        document.theForm.logicalHosts.options.length = rr.length;
}
function SetLogicalHostsOnLoad(){

//alert("options.length="+document.theForm.logicalHosts.options.length);
        var rr = LogicalHostArray[document.theForm.eventType.selectedIndex];
        //alert("selectedIndex="+document.theForm.eventType.selectedIndex);
        //alert("rr="+rr[i].text);
        for(i = 0; i < rr.length; ++i) {
                document.theForm.logicalHosts.options[i] = rr[i];
        }
        document.theForm.logicalHosts.options.length = rr.length;
        for(i = 0; i < document.theForm.logicalHosts.options.length ; ++i) {
                document.theForm.logicalHosts.options[i].selected = "";
        }


}
</SCRIPT>
</HEAD>
<BODY onload="SetLogicalHostsOnLoad()">

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HEAD>
<META name="GENERATOR" content="IBM WebSphere Studio">

<TITLE>V3 Administration</TITLE>
</HEAD>


<table>
  <tr>

    <td valign="middle"><IMG SRC="../images/eBayLogo.gif"
ALT="eBay"></td>
    <td valign="middle"><font face="arial" size="5"
valign="middle"><B>V3 Administration Console</B></font><p>
      <font face="arial" size="3"
valign="middle"><B>Host:&nbsp;C-BESAPP-01/10.17.71.189</B></font><p>
    </td>
  </tr>
</table>
<p>




<form method="post" name="theForm"
action="/admin/v3console/BESGenericProducer">
<input type="hidden" name="event" value=""/>
<h1>BES Generic Producer</h1>
<fieldset>
        <legend>Event Generation</legend>
    <table><tr><td>
                <table>
                <tr><td align="left">Event</td>
        <td align="left">

                <select name="eventType" onchange="SetLogicalHosts()">


                        <option value="ACCOUNT.UPDATE">ACCOUNT.UPDATE</option>


                        <option
value="ACCOUNT_DETAIL.REJECT.NEW">ACCOUNT_DETAIL.REJECT.NEW</option>
...........

Here is the Exception:
==========================

org.mozilla.javascript.WrappedException: Wrapped
java.lang.NullPointerException (Embedded script#2331)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context
.java:1693)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:157)
at org.mozilla.javascript.ScriptableObject.setBySetter(Scriptabl
eObject.java:1704)
at org.mozilla.javascript.ScriptableObject.put(ScriptableObject.
java:239)
at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.put
(SimpleScriptable.java:283)
at org.mozilla.javascript.ScriptableObject.putProperty(Scriptabl
eObject.java:1396)
at org.mozilla.javascript.ScriptRuntime.setObjectProp(ScriptRunt
ime.java:1432)
at org.mozilla.javascript.ScriptRuntime.setObjectProp(ScriptRunt
ime.java:1422)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.
java:2824)
at script.SetLogicalHosts(Embedded script:2331)
at script(event for HtmlSelect[<select name="eventType" onchange
="SetLogicalHosts()">]:1)

_______________________________________________
mozilla-jseng mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-jseng