[richfaces-svn-commits] JBoss Rich Faces SVN: r12024 - in trunk/ui/inplaceInput/src/main: templates and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Dec 24 13:52:59 EST 2008


Author: vmolotkov
Date: 2008-12-24 13:52:59 -0500 (Wed, 24 Dec 2008)
New Revision: 12024

Modified:
   trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
   trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4595

Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js	2008-12-24 18:52:54 UTC (rev 12023)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js	2008-12-24 18:52:59 UTC (rev 12024)
@@ -121,7 +121,7 @@
 	},
 	
 	edit: function (){
-		if (this.invokeEvent(this.events.oneditactivation, this.inplaceInput, "rich:oneditactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
+		if (Richfaces.invokeEvent(this.events.oneditactivation, this.inplaceInput, "rich:oneditactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
 			this.startEditableState();
 			if (this.events.oneditactivated) {
 				this.inplaceInput.fire("rich:oneditactivated", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value});
@@ -275,7 +275,7 @@
 	},
 	
 	cancel : function(e, value) {
-		if (this.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
+		if (Richfaces.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
 			this.endEditableState();
 			if (!value) {
 				value = this.valueKeeper.value;	
@@ -301,7 +301,7 @@
 	},
 	
 	save : function(e) {
-		if (this.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
+		if (Richfaces.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
 			var userValue = this.tempValueKeeper.value;
 			this.setValue(userValue);
 			if (this.events.onviewactivated) {
@@ -338,7 +338,7 @@
 			this.startChangedState();
 			if	(value != userValue) {
 				this.tempValueKeeper.value = userValue;
-				this.invokeEvent(this.events.onchange, this.inplaceInput, "onchange", userValue);
+				Richfaces.invokeEvent(this.events.onchange, this.inplaceInput, "onchange", userValue);
 			}
 		
 		} else {
@@ -350,36 +350,6 @@
 		return this.valueKeeper.value;
 	},
 
-	//TODO: remove Bucks
-	//TODO: to shared library
-	invokeEvent : function(eventFunc, element, eventName, memo) {
-		var result;
-		if (eventFunc) {
-			element = $(element);
-      		if (element == document && document.createEvent && !element.dispatchEvent)
-        		element = document.documentElement;
-
-      		var event;
-      		if (document.createEvent) {
-        		event = document.createEvent("HTMLEvents");
-        		event.initEvent("dataavailable", true, true);
-     	 	} else {
-        		event = document.createEventObject();
-        		event.eventType = "ondataavailable";
-      		}
-
-      		event.eventName = eventName;
-      		event.rich = {component:this};
-     		event.memo = memo || { };
-			try {
-				result = eventFunc.call(element,event);
-			}
-			catch (e) { LOG.warn("Exception: "+e.Message + "\n[on"+eventName + "]"); }	
-		}
-		if (result!=false) result = true;
-		return result;
-	},
-	
 	setDefaultText : function() {
 		this.currentText = this.attributes.defaultLabel;
 	},

Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx	2008-12-24 18:52:54 UTC (rev 12023)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx	2008-12-24 18:52:59 UTC (rev 12024)
@@ -15,9 +15,9 @@
 	<h:scripts>
 			new org.ajax4jsf.javascript.PrototypeScript(),
 			scripts/comboboxUtils.js,
+			scripts/utils.js,
 			scripts/inplaceinput.js,
-			scripts/inplaceinputstyles.js,
-			scripts/utils.js
+			scripts/inplaceinputstyles.js
 	</h:scripts>
 	<f:resource var="saveIcon" name="org.richfaces.renderkit.html.images.SaveControlIcon"/>
 	<f:resource var="cancelIcon" name="org.richfaces.renderkit.html.images.CancelControlIcon"/>




More information about the richfaces-svn-commits mailing list