Author: pyaschenko
Date: 2010-04-15 06:40:49 -0400 (Thu, 15 Apr 2010)
New Revision: 16763
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
RichFaces.$ was added
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
---
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-04-15
07:10:19 UTC (rev 16762)
+++
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-04-15
10:40:49 UTC (rev 16763)
@@ -16,8 +16,8 @@
(function (jQuery, richfaces, params) {
// Constructor definition
- richfaces.MyComponent = function(componentId) {
- $super.constructor.call(this, componentId);
+ richfaces.MyComponent = function(componentId, [options]) {
+ $super.constructor.call(this, componentId, [options]);
};
// Extend component class
Modified: root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
---
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-04-15
07:10:19 UTC (rev 16762)
+++
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-04-15
10:40:49 UTC (rev 16763)
@@ -10,6 +10,32 @@
window.RichFaces = {};
(function(richfaces, jQuery) {
+
+ // get RichFaces component object by component id or DOM element or jQuery object
+ richfaces.$ = function (source) {
+ var type = typeof source;
+ var element;
+ if (type == "string") {
+ // id
+ element = document.getElementById(source);
+ } else if (type == "object") {
+ if (source.nodeType) {
+ // DOM element
+ element = source;
+ } else
+ if (source instanceof jQuery) {
+ // jQuery object
+ element = source.get(0);
+ }
+ }
+
+ if (element) {
+ return element["richfaces" || {}]["component"];
+ }
+
+ return;
+ }
+
//form.js
richfaces.submitForm = function(form, parameters, target) {
if (typeof form === "string") { form = jQuery(form) };
Show replies by date