Interface basic


public interface basic

basic.js contains the basic functionality necessary to make calls into the API. All HTML using the API must include this file. Also exposed in this file are the API calls necessary to register for events.


Field Summary
static java.lang.String EVENT_ERROR
          The event constant used to register for the onError event
 
Method Summary
 java.lang.String fireEvent(java.lang.String eventConstant, java.lang.Object arg0, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9)
          Fires an event to the handler registered for that event.
 java.awt.Window getWAM()
          Obtains a reference to the WATA Applet Manager DOM window.
 void onError(java.lang.String description, int code0, int code1, int code2, int code3, int code4)
          This is the prototype for an event.
 java.lang.String registerForEvent(java.lang.String eventConstant)
          Registers the window that calls this method to receive the event specified.
 java.lang.String unregisterForEvent(java.lang.String eventConstant)
          Unregisters the current event handler for the event specified.
 

Field Detail

EVENT_ERROR

public static final java.lang.String EVENT_ERROR
The event constant used to register for the onError event

See Also:
registerForEvent(String), Constant Field Values
Method Detail

getWAM

public java.awt.Window getWAM()
Obtains a reference to the WATA Applet Manager DOM window. This window contains all of the Applets that enable the API. This method is for internal use only.

Returns:
Returns a reference to the WAM window.

registerForEvent

public java.lang.String registerForEvent(java.lang.String eventConstant)
Registers the window that calls this method to receive the event specified. If a window registers for an event, it will replace the last window that registered as the handler. If a window registers for a given event, it must also implement the method call associated with that event. For example, if a window registers for EVENT_ONSCAN, it must, in that same window declare and implement onScan( s ). The argument name is optional.

Parameters:
eventConstant - The event constant exposed by the API for the given event.
Returns:
Returns null when the registration is successful. If the registration fails, a String will be returned with a description of the cause of the failure.

unregisterForEvent

public java.lang.String unregisterForEvent(java.lang.String eventConstant)
Unregisters the current event handler for the event specified.

Parameters:
eventConstant - The event constant exposed by the API for the given event.

onError

public void onError(java.lang.String description,
                    int code0,
                    int code1,
                    int code2,
                    int code3,
                    int code4)
This is the prototype for an event. It is not actually implemented in this file. Fired when an error occurs in the system The parameters indicate details about the error.

WATA Integration
Host AppletAll Applets and JavaScript have access to firing this event

fireEvent

public java.lang.String fireEvent(java.lang.String eventConstant,
                                  java.lang.Object arg0,
                                  java.lang.Object arg1,
                                  java.lang.Object arg2,
                                  java.lang.Object arg3,
                                  java.lang.Object arg4,
                                  java.lang.Object arg5,
                                  java.lang.Object arg6,
                                  java.lang.Object arg7,
                                  java.lang.Object arg8,
                                  java.lang.Object arg9)
Fires an event to the handler registered for that event. Example Usage: fireEvent( EVENT_ERROR, "Unable to communicate with applet", 500, 2 );

Parameters:
eventConstant - The event constant exposed by the API for the given event.
arg0 - An optional argument to deliver to the event handler
arg1 - An optional argument to deliver to the event handler
arg2 - An optional argument to deliver to the event handler
arg3 - An optional argument to deliver to the event handler
arg4 - An optional argument to deliver to the event handler
arg5 - An optional argument to deliver to the event handler
arg6 - An optional argument to deliver to the event handler
arg7 - An optional argument to deliver to the event handler
arg8 - An optional argument to deliver to the event handler
arg9 - An optional argument to deliver to the event handler