Echo
Client
Class Hierarchy:
Direct Known Subclasses:
Echo.FreeClient

Abstract base class for Echo clients.

Descendant Class Summary
Echo.Client.DefaultWaitIndicator
Echo.Client.Timer
Echo.Client.WaitIndicator

Constructor Summary
Public Echo.Client()
Creates a new Client instance.

Class Field Summary
Internal _activeClients
Global array containing all active client instances in the current browser window.

Class Method Summary
Internal _globalWindowResizeListener()
Global listener to respond to resizing of browser window.

Instance Method Summary
Public, Virtual getResourceUrl()
Returns the URL of a resource based on package name / resource name information.
Public, Virtual verifyInput()
Determines if the specified component and containing application is ready to receive input.
Public, Virtual dispose()
Default dispose implementation.
Public configure()
Configures/Deconfigures the client.
Public createInputRestriction()
Registers a new input restriction.
Public exec()
Loads required libraries and then executes a function, adding input restrictions while the libaries are being loaded.
Public fail()
Handles an application failure, refusing future input and displaying an error message over the entirety of the domain element.
Internal _forceIERedraw()
Forces IE browser to re-render entire document if the height of the application's domain element measures zero.
Internal _processApplicationFocus()
Listener for application change of component focus: invokes focus() method on focused component's peer.
Internal _processKeyPress()
Root KeyDown event handler.
Public processUpdates()
Processes updates to the component hierarchy.
Public registerRestrictionListener()
Registers a listener to be notified when all input restrictions have been removed.
Public removeInputRestriction()
Removes an input restriction.
Public setWaitIndicator()
Sets the wait indicator that will be displayed when a client-server action takes longer than a specified period of time.
Internal _waitIndicatorActivate()
Activates the wait indicator.
Internal _windowResizeListener()
Instance listener to respond to resizing of browser window.

Constructor Detail
Echo.Client()
Creates a new Client instance. Derived classes must invoke.

Class Method Detail
_globalWindowResizeListener
Global listener to respond to resizing of browser window. Invokes _windowResizeListener() method on all active clients.
Parameters:
e - the DOM resize event

Instance Method Detail
getResourceUrl
Returns the URL of a resource based on package name / resource name information. Derived implementations should generally override this method, and delegate to superclass if they are unable to provide a resource for a specific URL. Default implementation delegates to parent client (if one is present) or otherwise returns null.
Parameters:
packageName (String) - the package name in which the resource is contained
resourceName (String) - the resource name
Returns:
(String) the full URL

verifyInput
Determines if the specified component and containing application is ready to receive input. This method should be overridden by client implementations as needed, returning the value from this implementation if the client has no other reason to disallow input.
Parameters:
component (Echo.Component) - optional parameter indicating the component to query (if omitted, only the application's readiness state will be investigated)
Returns:
(Boolean) true if the application/component are ready to receive input

dispose
Default dispose implementation. Invokes configure(null, null) to deconfigure the client.

configure
Configures/Deconfigures the client. This method must be invoked with the supported application/containing domain element before the client is used, and invoked with null values before it is disposed (in order to clean up resources).
Parameters:
application (Echo.Application) - the application the client will support (if configuring) or null (if deconfiguring)
domainElement (Element) - the DOM element into which the client will be rendered (if configuring), or null (if deconfiguring)

createInputRestriction
Registers a new input restriction. Input will be restricted until this and all other input restrictions are removed.
Returns:
a handle identifier for the input restriction, which will be used to unregister the restriction by invoking removeInputRestriction()

exec
Loads required libraries and then executes a function, adding input restrictions while the libaries are being loaded.
Parameters:
requiredLibraries (Array) - the URLs of the libraries which must be loaded before the function can execute
f (Function) - the function to execute

fail
Handles an application failure, refusing future input and displaying an error message over the entirety of the domain element.
Parameters:
msg (String) - the message to display (a generic message will be used if omitted)

_forceIERedraw
Forces IE browser to re-render entire document if the height of the application's domain element measures zero. This is a workaround for an Internet Explorer bug where the browser's rendering engine fundamentally fails and simply displays a blank screen (commonly referred to on bug-tracker/forum as the "blank screen of death"/BSOD). This bug appears to be most prevalent in IE7.

_processApplicationFocus
Listener for application change of component focus: invokes focus() method on focused component's peer.
Parameters:
e - the event

_processKeyPress
Root KeyDown event handler. Specifically processes tab key events for focus management.
Parameters:
e - the event

processUpdates
Processes updates to the component hierarchy. Invokes Echo.Render.processUpdates().

registerRestrictionListener
Registers a listener to be notified when all input restrictions have been removed.
Parameters:
component (Echo.Component) - the component for which the restriction listener is being registered
l (Function) - the method to notify when all input restrictions have been cleared

removeInputRestriction
Removes an input restriction.
Parameters:
id (String) - the id (handle) of the input restriction to remove

setWaitIndicator
Sets the wait indicator that will be displayed when a client-server action takes longer than a specified period of time.
Parameters:
waitIndicator (Echo.Client.WaitIndicator) - the new wait indicator

_waitIndicatorActivate
Activates the wait indicator.

_windowResizeListener
Instance listener to respond to resizing of browser window.
Parameters:
e - the DOM resize event