Object doesn't support this property or method
843836Sep 16 2003 — edited Sep 17 2003Question at end
******************** Start of Code ************************
Simple applet:
import java.applet.Applet;
import java.awt.Graphics;
import netscape.javascript.JSObject;
import netscape.javascript.JSException;
public class StatusApplet extends Applet {
private String port="8111";
private JSObject win,doc,form, field;
public void init() {
win = JSObject.getWindow(this);
doc = (JSObject)win.getMember("document");
form = (JSObject)doc.getMember("newports");
field = (JSObject)form.getMember("dbport");
}
public void paint(Graphics g) {
g.drawString("Hello world!", 50, 25);
}
public void getPort() {
form.setMember("dbport",port);
}
}
Simple html:
<%@ page language="java" import="java.io.*,java.net.*,java.sql.*,netscape.javascript.JSObject" contentType="text/html" %>
<HTML>
<applet code="StatusApplet.class" codebase="./dbstatus" name="portsApplet" width="0" height="0">
</applet>
<TITLE>Change Application Ports </TITLE>
</HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
function updateDBport() {
document.newports.dbport.disabled=false
window.document.portsApplet.getPort()
}
//--> </SCRIPT>
<BODY BACKGROUND="" BGCOLOR="#00BFFF">
<h1>Change Application Ports </h1>
<TABLE>
<FORM name=newports method="post" action="takeaction.jsp"
<TR><TD></TD>
<TD><select name="dbserver" onChange="updateDBport(this.form.dbserver)" SIZE=1>
<option selected value=0>None
<option value=1> server1
...
<input type=text disabled size=5 name=dbport>
</FORM></TABLE></BODY></HTML>
****************** END OF CODE ***************************
the object is to select the server and have the applet populate the port
but all I get is the subject error when the I call the applet.method();
Any ideas why or what I might do to correct it?