| PREV CLASS Documentation homepage NEXT CLASS |
IlvObject
IlvObject (or any of its subclasses),
do the following:
1 - Define a constructor for your new class. For example:
function MySubclass (params) {
// Call the super constructor.
this.superConstructor(params);
// Some additional initialization code.
}
2 - Make it a subclass of MySuperclass,
(note that the following code will not work if MySuperclass
is not IlvObject or one of its subclasses). For example:
IlvObject.inherits(MySuperclass, MySubclass);
3 - Define additional methods. For example:
MySubclass.prototype.foo = function (bar) {
// Some code.
}
4 - Override, if necessary, some methods of the superclass. For example:
MySubclass.prototype.setSize = function (width, height) {
this.superInvoke("setSize",width,height);
// Some additional code.
}
| Constructor Summary | |
|---|---|
IlvObject()
|
|
| Method Summary | |
|---|---|
callDispose()
Disposes all user objects that have been registered by calling the IlvObject.prototype.registerDispose method. |
|
dispose()
Disposes of all resources being used by this object. |
|
getClassName()
Returns the class name of this object. |
|
hashCode()
Returns a hash code value for this object. |
|
inherits(parent, sub, className)
Make sure the sub class inherits from the
parent class. |
|
instanceOf(clazz)
Returns true if this object is an instance of the given class,
or false otherwise. |
|
invoke(method, param1, paramn)
Invokes the provided method for this object. |
|
registerDispose()
Registers the object's dispose method to be called when the
IlvObject.callDispose() function is invoked. |
|
removeHTML()
Erase the printed HTML content of the object The SubClasses with HTML Elements such as IlvHTMLPanel should override this method |
|
setClassName(className)
Sets the class name of this object. |
|
superConstructor(param1, paramn)
Invokes the constructor of the superclass on this object. |
|
superInvoke(method, param1, paramn)
Invokes a method of the superclass on this object. |
|
toString()
Returns a string representation of this object. |
|
updateVisibility()
Update the visibility state of the component. |
|
| Constructor Detail |
IlvObject()
| Method Detail |
static callDispose()
IlvObject.prototype.registerDispose method. This method invokes the
IlvObject.prototype.dispose method of each registered object.
This method
must be called on the onunload event of the page. dispose()
If a subclass instance contains references to DOM entities, that class should
override this method and make sure to call superInvoke like this:
MySubclass.prototype.dispose = function() {
this.superInvoke("dispose");
this.aDOMElement = null;
// Remove any other references to DOM entities.
}
The subclass instance must also register to have its dispose
method invoked. This is done by calling the registerDispose
method at the end of the subclass constructor:
function MySubclass(params) {
this.superConstructor(params);
// Initialize the instance.
this.registerDispose();
}
Finally, you must make sure to call the IlvObject.callDispose()
function on the onunload event of the page:
This will be done for you when using the JSF components.<body onunload="IlvObject.callDispose()">
getClassName()
hashCode()
static inherits(parent, sub, className)
sub class inherits from the
parent class.
The method parameter can be the name of the method
or a function. parent - The super class.sub - The sub class.
instanceOf(clazz)
true if this object is an instance of the given class,
or false otherwise.
If the given class is undefined, this method also returns false. invoke(method, param1, paramn)
this keyword refers to this object. method - The method to be invoked on this object.
The method parameter can be the name of the method
or a function.param1....paramn - The parameters to be used when the method is invoked.registerDispose()
dispose method to be called when the
IlvObject.callDispose() function is invoked. removeHTML()
setClassName(className)
superConstructor(param1, paramn)
param1....paramn - The parameters to be used when the method is invoked.superInvoke(method, param1, paramn)
anObject.superInvoke("theMethod", someParameters);
anObject.invoke("superClass.prototype.theMethod", someParameters);
Note: There is a constraint; the method using superInvoke
cannot be recursive. method - The name (a string) of the superclass method
to be invoked.param1....paramn - The parameters to be used when the method is invoked.toString()
updateVisibility()
| PREV CLASS Documentation homepage NEXT CLASS |