Author: pyaschenko
Date: 2010-12-23 07:43:08 -0500 (Thu, 23 Dec 2010)
New Revision: 20764
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
Log:
Base class for ui components was added
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
---
trunk/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-12-23
12:22:24 UTC (rev 20763)
+++
trunk/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-12-23
12:43:08 UTC (rev 20764)
@@ -297,4 +297,36 @@
};
})(params));
+})(jQuery, window.RichFaces || (window.RichFaces={}));
+
+// RichFaces Base class for ui components
+(function($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ // Constructor definition
+ rf.ui.Base = function(componentId, options, defaultOptions) {
+ this.namespace = "."+rf.Event.createNamespace(this.name, componentId);
+ // call constructor of parent class
+ $super.constructor.call(this, componentId);
+ this.options = $.extend(this.options, defaultOptions, options);
+ this.attachToDom();
+ this.__bindEventHandlers();
+ };
+
+ // Extend component class and add protected methods from parent class to our container
+ rf.BaseComponent.extend(rf.ui.Base);
+
+ // define super class link
+ var $super = rf.ui.Base.$super;
+
+ $.extend(rf.ui.Base.prototype, {
+ __bindEventHandlers: function () {
+ },
+ destroy: function () {
+ rf.Event.unbind(this.id, this.namespace);
+ $super.destroy.call(this);
+ }
+ });
+
})(jQuery, window.RichFaces || (window.RichFaces={}));
\ No newline at end of file
Show replies by date