Author: pyaschenko
Date: 2007-09-05 10:31:15 -0400 (Wed, 05 Sep 2007)
New Revision: 2769
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
Richfaces.invokeOnComponent function renamed to Richfaces.getComponent
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
---
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-09-05
14:06:48 UTC (rev 2768)
+++
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-09-05
14:31:15 UTC (rev 2769)
@@ -136,12 +136,13 @@
return value;
}
-Richfaces.invokeOnComponent = function(componentType, element, functionName, event)
+Richfaces.getComponent = function(componentType, element)
{
var attribute="richfacesComponent";
+ var type = "richfaces:"+componentType;
while (element.parentNode) {
- if (element[attribute] && element[attribute]==componentType)
- return element.component[functionName](event);
+ if (element[attribute] && element[attribute]==type)
+ return element.component;
else
element = element.parentNode;
}
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
---
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-09-05
14:06:48 UTC (rev 2768)
+++
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-09-05
14:31:15 UTC (rev 2769)
@@ -1289,7 +1289,7 @@
CalendarView = {};
CalendarView.getControl = function(text, functionName) {
var attr = {
- onclick: (functionName ?
"Richfaces.invokeOnComponent('richfaces:calendar',this,'"+functionName+"');"
: "")+"return false;",
+ onclick: (functionName ?
"Richfaces.getComponent('calendar',this)."+functionName+"();"
: "")+"return true;",
className: "rich-calendar-btn"
};
@@ -1298,7 +1298,7 @@
CalendarView.getSelectedDateControl = function(text, functionName) {
var attr = {
- onclick:
"Richfaces.invokeOnComponent('richfaces:calendar',this,'showSelectedDate');
return false;",
+ onclick: "Richfaces.getComponent('calendar',this).showSelectedDate();
return true;",
className: "rich-calendar-btn"
};
@@ -1306,7 +1306,7 @@
if (text)
{
a.push(new T(" "));
- a.push(new E('a', {href: '#', onclick:
"Richfaces.invokeOnComponent('richfaces:calendar',this,'resetSelectedDate');return
false;"}, [new T('(x)')]));
+ a.push(new E('a', {href: '#', onclick:
"Richfaces.getComponent('calendar',this).resetSelectedDate();return
true;"}, [new T('(x)')]));
}
return new E('div',attr,a);
Show replies by date