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 Attributes | Constructor Name and Description |
|---|---|
| Method Attributes | Method Name and Description |
|---|---|
|
IlvObject.
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.
|
|
|
IlvObject.
disposeByClientId(clientId)
Dispose the proxy instance by clientId from IlvObject.disposeProxyInstances
|
|
|
Returns the class name of this object.
|
|
|
hashCode()
Returns a hash code value for this object.
|
|
|
IlvObject.
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, paramn)
Invokes the provided method for this object.
|
|
|
Registers the object's
dispose method to be called when the
IlvObject.callDispose() function is invoked. |
|
|
registerDisposeByClientId(clientId)
Register one proxy instance by
clientId into IlvObject.disposeProxyInstances. |
|
|
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(paramn)
Invokes the constructor of the superclass on this object.
|
|
|
superInvoke(method, paramn)
Invokes a method of the superclass on this object.
|
|
|
toString()
Returns a string representation of this object.
|
|
|
Update the visibility state of the component.
|
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.
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()">
clientId from IlvObject.disposeProxyInstances
sub class inherits from the
parent class.
The method parameter can be the name of the method
or a function.
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.
this keyword refers to this object.
dispose method to be called when the
IlvObject.callDispose() function is invoked.
clientId into IlvObject.disposeProxyInstances.
anObject.superInvoke("theMethod", someParameters);
anObject.invoke("superClass.prototype.theMethod", someParameters);
Note: There is a constraint; the method using superInvoke
cannot be recursive.