Echo3ClientScriptApplication

The Echo3 client-side "Application.js" module provides a client-side JavaScript version of the Echo3 Application Framework. It defines the fundamental "Application" and "Component" classes, in addition to all components found in the core framework, all core property types, and an UpdateManager implementation.

This single file contains essentially contains a simplified version of all code in the nextapp.echo.app package hierarchy, adapted to client-side JavaScript. As such, the code has been leaned out a bit. For example, setters and getters are not provided for each property of each component class, but rather only the basic get(Indexed)Property and set(Indexed)Property methods are provided.

The application module does not provide any information on how the components should be rendered, just like in a server-side implementation of Echo3.

Creating Components

To create a new component with no properties, simply invoke its constructor, e.g.:

var testLabel = new Label();

Additionally, arbitrary properties may be set at construction. The first argument to any component constructor is its initial properties, speified as an associative array. The following example creates a Label with a few properties set:

var testLabel = new Label({ 
    text: "Hello, world",
    background: new EchoApp.Color(0xabcdef),
    foreground: new EchoApp.Color(0x123456)
};

last edited 2007-10-14 13:54:17 by TodLiebeck