Echo
Render
Class Hierarchy:

Application rendering namespace.

Descendant Class Summary
Echo.Render.ComponentSync
Echo.Render.RootSync

Class Field Summary
Internal _loadedPeerCount
Count of loaded/unloaded peers.
Internal _nextPeerId
Next sequentially assigned unique peer identifier.

Class Method Summary
Internal _componentDepthArraySort()
An array sorting implementation to organize an array by component depth.
Internal _doRenderDisplay()
Recursively invokes renderDisplay() method on a sub-hierarchy of the component hierarchy.
Internal _doRenderDisplayImpl()
Recursive work method for _doRenderDisplay().
Internal _getComponentDepth()
Returns the depth of a specific component in the hierarchy.
Internal _loadPeer()
Creates a component synchronization peer for a component.
Public notifyResize()
Notifies child components that the parent component has been drawn or resized.
Internal _processDispose()
Invokes renderDispose() on all removed children and descendants found in the specified update.
Public processUpdates()
Processes all pending updates in the client's application's update manager.
Public registerPeer()
Registers a component type name with an instantiable peer class.
Public renderComponentAdd()
Renders a new component inside of a DOM element.
Public renderComponentDisplay()
Manually invokes renderDisplay on a component (and its descendants) that was added to the hierarchy outside of processUpdates().
Public renderComponentDispose()
Disposes of a component and its descendants.
Internal _renderComponentDisposeImpl()
Recursive implementation of renderComponentDispose.
Internal _setPeerDisposedState()
Sets the peer disposed state of a component.
Internal _unloadPeer()
Destroys a component synchronization peer for a specific components.
Public updateFocus()
Focuses the currently focused component of the application.

Class Method Detail
_componentDepthArraySort
An array sorting implementation to organize an array by component depth.

_doRenderDisplay
Recursively invokes renderDisplay() method on a sub-hierarchy of the component hierarchy. If a peer does not provide a renderDisplay() implementation, it is skipped (although its descendants will NOT be skipped).
Parameters:
the (Echo.Component) - root component of the sub-hierarchy on which renderDisplay() should be invoked
includeSelf (Boolean) - flag indicating whether renderDisplay() should be invoked on the specified component (if false, it will only be invoked on child components)

_doRenderDisplayImpl
Recursive work method for _doRenderDisplay().
Parameters:
component (Echo.Component) - the component on which to invoke renderDisplay()

_getComponentDepth
Returns the depth of a specific component in the hierarchy. The root component is at depth 0, its immediate children are at depth 1, their children are at depth 2, and so on.
Parameters:
component (Echo.Component) - the component whose depth is to be calculated
Returns:
(Number) the depth of the component

_loadPeer
Creates a component synchronization peer for a component. The peer will be stored in the "peer" property of the component. The client will be stored in the "client" property of the component.
Parameters:
client (Echo.Client) - the relevant Client
component (Echo.Component) - the component

notifyResize
Notifies child components that the parent component has been drawn or resized. At this point the parent component is on the screen (the parent element is part of the DOM hierarchy). Child components (and their descendants) will be notified by having their renderDisplay() implementations invoked. Note that the parent WILL NOT have its renderDisplay() method invoked.

If your component requires virtual positioning (for IE6) you should invoke this method after informing the virtual positioning system to recalculate the size of your component.

Parameters:
parent (Echo.Component) - the component whose size changed

_processDispose
Invokes renderDispose() on all removed children and descendants found in the specified update.
Parameters:
update (Echo.Update.ComponentUpdate) - the update

processUpdates
Processes all pending updates in the client's application's update manager.
Parameters:
client (Echo.Client) - the client

registerPeer
Registers a component type name with an instantiable peer class. Components of the specified type name will be assigned new instances of the peer class when rendered for the first time.
Parameters:
componentName (String) - the component type name
peerObject (Function) - the peer class object

renderComponentAdd
Renders a new component inside of a DOM element. This method should be called by container components in order to render their children.
Parameters:
update (Echo.Update.ComponentUpdate) - the relevant ComponentUpdate
component (Echo.Component) - the component to add
parentElement (Element) - the DOM element to which the rendered component should be added

renderComponentDisplay
Manually invokes renderDisplay on a component (and its descendants) that was added to the hierarchy outside of processUpdates(). This method is only used in special cases, e.g., by in the case of Application Rendered Components that need to render children.
Parameters:
parent (Echo.Component) - the parent component of the sub-hierarchy on which renderDisplay() should be invoked (note that renderDisplay WILL be invoked on the parent as well as its descendants)

renderComponentDispose
Disposes of a component and its descendants. This method should be invoked by any peer that will be updating a component in such a fashion that it will be destroying the rendering of its children and re-rendering them. It is not necessary to invoke this method on components that may not contain children.
Parameters:
update (Echo.Update.ComponentUpdate) - the ComponentUpdate for which this change is being performed
component (Echo.Component) - the Component to be disposed

_renderComponentDisposeImpl
Recursive implementation of renderComponentDispose. Invokes renderDispose() on all child peers, sets disposed state on each.
Parameters:
update (Echo.Update.ComponentUpdate) - the ComponentUpdate for which this change is being performed
component (Echo.Component) - the Component to be disposed

_setPeerDisposedState
Sets the peer disposed state of a component. The peer disposed state indicates whether the renderDispose() method of the component has been executed since it was last rendered.
Parameters:
component (Echo.Component) - the component
disposed (Boolean) - the disposed state, true indicating the component has been disposed

_unloadPeer
Destroys a component synchronization peer for a specific components. The peer will be removed from the "peer" property of the component. The client will be removed from the "client" property of the component. The peer to component association will be removed.
Parameters:
component (Echo.Component) - the component

updateFocus
Focuses the currently focused component of the application. This method may be necessary to invoke manually by component renderers that use animation and may be hiding the focused component (such that the client browser will not focus it) when processUpdates() completes.
Parameters:
client (Echo.Client) - the client