You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2006/02/26 23:39:41 UTC

svn commit: r381192 - /myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/statechangednotifier/resource/stateChangedNotifier.js

Author: werpu
Date: Sun Feb 26 14:39:38 2006
New Revision: 381192

URL: http://svn.apache.org/viewcvs?rev=381192&view=rev
Log:
added two convenience methods

Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/statechangednotifier/resource/stateChangedNotifier.js

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/statechangednotifier/resource/stateChangedNotifier.js
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/statechangednotifier/resource/stateChangedNotifier.js?rev=381192&r1=381191&r2=381192&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/statechangednotifier/resource/stateChangedNotifier.js (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/statechangednotifier/resource/stateChangedNotifier.js Sun Feb 26 14:39:38 2006
@@ -100,6 +100,7 @@
             this.objectsToConfirmList.push(elementId);
         } else {
         	this.removeConfirmInElement(elementId); //remove old includes from the list if we get one 
+        	//putNoConfirmInElement(elementId); // we need a special resetter list which reset the control if triggered
         }
     }
     for (var cnt2 = 0; cnt2 < this.objectsToConfirmList.length; cnt2 += 1) {
@@ -124,6 +125,13 @@
         }
     }
 };
+
+org_apache_myfaces_StateChangedNotifier.prototype.resetHiddenField = function() {
+    var hiddenField = dojo.byId(this.hiddenFieldId);
+	if(hiddenField !== null)
+    	hiddenField.value = "false";
+};
+
 /**
 * builds up a show message function
 * dependend on the correct browser
@@ -148,6 +156,25 @@
 		command.setAttribute("onclick",oldOnClick);
 	}	
 }
+
+
+
+org_apache_myfaces_StateChangedNotifier.prototype.putNoConfirmInElement = function (commandId) {
+    var command = dojo.byId(commandId);
+    if (command !== null) {
+        var onclick = command.getAttribute("onclick");
+        var onclickstr = onclick + "";
+        command.setAttribute("old_onclick", onclickstr);
+        if (dojo.render.html.ie) {
+            onclickstr = onclickstr.replace(/function anonymous\(\)/, "");
+            onclickstr = "" + this.notifierName + ".resetHiddenField(); " + onclickstr + " ;";
+            command.setAttribute("onclick", new Function("", onclickstr));
+            
+        } else {
+            command.setAttribute("onclick", "" + this.notifierName + ".resetHiddenField();" + onclick + " ;");
+        }
+    }
+};
 
 
 org_apache_myfaces_StateChangedNotifier.prototype.putConfirmInElement = function (commandId) {