File: ../../Developer.FoundationDotJS.org/wwwroot/Foundation.js

Foundation
Interface Elemental

Object
  
 
 
Foundation.Elemental

All Implemented Interfaces:

Interface

Direct Known Subclasses:

ClientLoader, Control, Game, Elemental

All Known Implementing Classes:

ClientLoader, Control, FloatControl, Game, Elemental


Foundation.Elemental

implements Foundation.Interface

Methods to interact with HTML elements and events. See the Foundation.Elemental home page for more information.

Note: This interface should be implemented, not extended.
Do not pass as first argument to Foundation.createClass function.


Field Summary
private Number$Foundation_$registry_index
A unique ID assigned to this object.

Method Summary
 attachEvent(element, eventName, code, delayed, disable)
 detachEvent(element, eventName, f)
StringelementId(/*String*/ id, /*Number*/ index)
Returns an ID that is unique to this object that can be used as HTML element IDs. No other instance of any class will generate the same ID even when passed the same parameter. The same instance will always generate the same ID when passed the same parameter.
Stringevent(/*String*/ code, /*Boolean*/ delayed, /*Boolean*/ disabled)
Returns code that can be used in DOM events to invoke methods and properties.
static  getById(id, decendantsToo)
ElementgetElement(/*String*/ id, /*Number*/ index)
Returns the HTML element that is unique to this object.
 getElementValue(id, defaultValue)
ArraygetElements(/*String*/ name, /*Number*/ index)
Returns the HTML elements that are unique to this object.
static  getFirst(decendantsToo)
static  getNext(o, decendantsToo)
 parseElementId(id)
 processHtml(html)
static  processHtml(html)

Methods inherited from Foundation.Interface
getTypePath

Field Detail

$Foundation_$registry_index

private Number $Foundation_$registry_index

A unique ID assigned to this object.

Method Detail

attachEvent

attachEvent(element,
            eventName,
            code,
            delayed,
            disable)
Parameters:
element - 

eventName - 

code - 

delayed - 

disable - 


detachEvent

detachEvent(element,
            eventName,
            f)
Parameters:
element - 

eventName - 

f - 


elementId

String elementId(/*String*/ id,
                 /*Number*/ index)

Returns an ID that is unique to this object that can be used as HTML element IDs. No other instance of any class will generate the same ID even when passed the same parameter. The same instance will always generate the same ID when passed the same parameter.

Parameters:
id - 
The ID unique in the class to append to the globaly unique ID.
index - 
(Optional) An optional index to append, for instance, when using for a radio button element.
Returns:
An ID that unique to this instance.

Example:

// The following button will call the update method of the object when clicked.
html+="<input type=button id=\""+this.elementId("uniqueButton")+"\" value=\"Update\" onclick=\""+this.event("update()")+"\">";
See Also:
getElement, getElements

event

String event(/*String*/ code,
             /*Boolean*/ delayed,
             /*Boolean*/ disabled)

Returns code that can be used in DOM events to invoke methods and properties.

Parameters:
code - 
The code of this object to be executed. If no parameters passed, returns the fully qualified object (to this).
delayed - 
(Optional) Delay the event using window.setTimeout. Set to true if the HTML element invoking the event will be destroyed during the event.
disabled - 
(Optional) If the event is delayed, disable the HTML element to prevent accidental duplicate events (like a button being pushed twice).
Returns:
The fully qualified code string for the event of the object.

Example:

// The following button will call the update method of the object when clicked.
html+="<input type=button value=\"Update\" onclick=\""+this.event("update()")+"\">";

getById

static getById(id,
               decendantsToo)
Parameters:
id - 

decendantsToo - 


getElement

Element getElement(/*String*/ id,
                   /*Number*/ index)

Returns the HTML element that is unique to this object.

Parameters:
id - 
The ID unique in the class.
index - 
(Optional) An optional index, use if an index was passed to elementId.
Returns:
The HTML element with the ID.

Example:

// Get the button that was created using the this.elementId("uniqueButton") method.
var button=this.getElement("uniqueButton");
See Also:
elementId, getElements

getElementValue

getElementValue(id,
                defaultValue)
Parameters:
id - 

defaultValue - 


getElements

Array getElements(/*String*/ name,
                  /*Number*/ index)

Returns the HTML elements that are unique to this object.

Parameters:
name - 
The name unique in the class.
index - 
(Optional) An optional index, use if an index was passed to elementId.
Returns:
The HTML elements with the name.

Example:

// Get the button that was created using the this.elementId("uniqueButton") method.
var button=this.getElement("uniqueButton");
See Also:
elementId, getElement

getFirst

static getFirst(decendantsToo)
Parameters:
decendantsToo - 


getNext

static getNext(o,
               decendantsToo)
Parameters:
o - 

decendantsToo - 


parseElementId

parseElementId(id)
Parameters:
id - 


processHtml

processHtml(html)
Parameters:
html - 


processHtml

static processHtml(html)
Parameters:
html -