Skip to main content
PREV CLASS NEXT CLASS FRAMES NO FRAMES

 

Class IlvObject

IlvObject

Category:
Common component
JavaScript File:
IlvUtil.js
Description:
The base class for all JavaScript classes. To create a subclass of an 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
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
IlvObject. callDispose()
Disposes all user objects that have been registered by calling the IlvObject.prototype.registerDispose method.
 
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.
 
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.
 
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.
 
Invokes the constructor of the superclass on this object.
 
superInvoke(method, paramn)
Invokes a method of the superclass on this object.
 
Returns a string representation of this object.
 
Update the visibility state of the component.
Constructor Detail
IlvObject
IlvObject()
Method Detail
callDispose
<static> IlvObject.callDispose()
Disposes all user objects that have been registered by calling the 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
dispose()
Disposes of all resources being used by this object. This default implementation does nothing. Subclasses should override this method in order to remove cyclic references between an object and the DOM. Such cyclic references between user objects and the DOM might prevent proper GC in some browsers, particularly IE.

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:
 <body onunload="IlvObject.callDispose()">
This will be done for you when using the JSF components.

disposeByClientId
<static> IlvObject.disposeByClientId(clientId)
Dispose the proxy instance by clientId from IlvObject.disposeProxyInstances
Parameters:
clientId
Since:
JViews8.6

getClassName
getClassName()
Returns the class name of this object.

hashCode
hashCode()
Returns a hash code value for this object.

inherits
<static> IlvObject.inherits(parent, sub, className)
Make sure the sub class inherits from the parent class. The method parameter can be the name of the method or a function.
Parameters:
parent - The super class.
sub - The sub class.
className
Since:
JViews 8.1

instanceOf
instanceOf(clazz)
Returns 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.
Parameters:
clazz
Deprecated:
Beginning with JViews 8.1 use JavaScript instanceof instead.

invoke
invoke(method, paramn)
Invokes the provided method for this object. When the code in the body of this method is executed, the this keyword refers to this object.
Parameters:
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.
paramn
Deprecated:
Beginning with JViews 8.1 use JavaScript Function.apply or Function.call method instead.

registerDispose
registerDispose()
Registers the object's dispose method to be called when the IlvObject.callDispose() function is invoked.

registerDisposeByClientId
registerDisposeByClientId(clientId)
Register one proxy instance by clientId into IlvObject.disposeProxyInstances.
Parameters:
clientId
Since:
JViews8.6

removeHTML
removeHTML()
Erase the printed HTML content of the object The SubClasses with HTML Elements such as IlvHTMLPanel should override this method

setClassName
setClassName(className)
Sets the class name of this object. Never call this method, unless you are creating a new class and using this object as its prototype.
Parameters:
className
Deprecated:
Beginning with JViews 8.1 call IlvObject.inherits(MySuperclass, MySubclass) instead.

superConstructor
superConstructor(paramn)
Invokes the constructor of the superclass on this object.
Parameters:
param1....paramn - The parameters to be used when the method is invoked.
paramn

superInvoke
superInvoke(method, paramn)
Invokes a method of the superclass on this object. This method is especially useful when overriding an implementation of a given method. This is a convenience method; the following two statements are equivalent:
anObject.superInvoke("theMethod", someParameters);
anObject.invoke("superClass.prototype.theMethod", someParameters);
Note: There is a constraint; the method using superInvoke cannot be recursive.
Parameters:
method - The name (a string) of the superclass method to be invoked.
param1....paramn - The parameters to be used when the method is invoked.
paramn

toString
toString()
Returns a string representation of this object. This implementation returns "theClassName_theHashCode".

updateVisibility
updateVisibility()
Update the visibility state of the component. This method is used with IlvPanel.visibilityLock boolean. If this boolean is not defined (default behavior) object.setVisible directly update the visibility of the component. If this boolean is set to true, a call to object.setVisible will update the visible state but not the concrete HTML visible state. A call to updateVisibility will show the HTML of the visible objects after setting IlvPanel.visibilityLock to false. This mechanism is used to hide the components until the appropriate moment to show them occurs.

©Copyright Rogue Wave Software Inc. 1997, 2018. All Rights Reserved.