wt.clients.util
Class WTJSObject

java.lang.Object
  extended by wt.clients.util.WTJSObject

public class WTJSObject
extends Object

A wrapper class for netscape.javascript.JSObject. This class can be used by Windchill client applications as a proxy for the netscape.javascript.JSObject. Using this class avoids needing the netscape.javascript.* classes in the Windchill codebase. The classes are supplied by the browsers at runtime.

Supported API: true

Extendable: false


Method Summary
 Object call(String methodName, Object[] args)
          Invoke the named method with the specified arguments.
static void callWithoutReturnValue(Applet applet, String methodName, Object[] args)
          Same as instance method of the same name except that this variation avoids creating a WTJSObject (and thus calling JSObject.getWindows(applet)) where this is unnecessary.
 void callWithoutReturnValue(String methodName, Object[] args)
          This method can be used whenever the return value of the given function call is not of interest.
static WTJSObject getWindow(Applet applet)
          Static method to obtain initial WTJSObject for applet's browser window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getWindow

public static WTJSObject getWindow(Applet applet)
                            throws WTException
Static method to obtain initial WTJSObject for applet's browser window.

Supported API: true

Throws:
WTException

call

public Object call(String methodName,
                   Object[] args)
            throws WTException
Invoke the named method with the specified arguments.

Supported API: true

Throws:
WTException

callWithoutReturnValue

public void callWithoutReturnValue(String methodName,
                                   Object[] args)
                            throws WTException
This method can be used whenever the return value of the given function call is not of interest. In this case when it is safer to do so we use showDocument() of a JavaScript URL to invoke the JavaScript function instead of JSObject.

Supported API: true

Throws:
WTException

callWithoutReturnValue

public static void callWithoutReturnValue(Applet applet,
                                          String methodName,
                                          Object[] args)
                                   throws WTException
Same as instance method of the same name except that this variation avoids creating a WTJSObject (and thus calling JSObject.getWindows(applet)) where this is unnecessary. This method should thus both have better performance and be more convenient for a single JavaScript call from a given applet instance. The instance method, on the other hand, does all setup work once and thus is better for repeated calls from a given applet instance. Currently this method uses JSObject if the browser is MSIE, and showDocument() if the browser is Mozilla/Netscape, because of a known JSObject issue with certain Mozilla/Netscape versions that return Javascript strings as some other sort of Javascript object, which causes problems with certain Javascript calls. If a particular applet prefers to always use JSObject and never use showDocument() regardless of browser/version, such as to support the passing of strings with multibyte characters from applet to page, then an applet parameter called "forceJSObject" should be set to "true". (SPR 1093978)

Supported API: true

Throws:
WTException