Identification Function per Class

Description

Identifies the root element of the control.

Syntax

function is<class name>()

Return Value

If the element is not part of a custom control of this class, return false.

If the element is part of a custom control of this class, return one of:

Remarks
Limitations

An identification function cannot return a FRAME element. This restriction applies to IFRAME elements as well.

If the element being learned is in a frame, the identification function cannot return an element that is outside that frame. If frames are nested, the identification cannot return an element from a frame at a different nesting level than the element being learned.

Example

This example shows the identification function for a calendar contained with other controls in a DIV. The root element of the custom control is the DIV.

From the toolkit configuration file:

<Control TestObjectClass="MyToolkitCalendar">

    <Identification type="javascript"

        file_name="MyCalendar.js" function="isMyToolKitCalender">

    </Identification>

</Control>

From MyCalendar.js:

function isMyToolKitCalender()

{

 

    var _div = _elem.parentNode;

 

    if ( _div != null )

    {

        If ( _div.tagName.toUpperCase() == "DIV" &&

            _div.className &&

            _div.className.indexOf("myToolKit-Calendar")

            != -1)

            return _div;

    }

 

    return false;

}