You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by dr...@apache.org on 2007/08/28 21:09:29 UTC

svn commit: r570531 - /myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js

Author: drobinson
Date: Tue Aug 28 12:09:29 2007
New Revision: 570531

URL: http://svn.apache.org/viewvc?rev=570531&view=rev
Log:
TRINIDAD-37 - Added onchange event based validation.
Not publicly enabled yet, but hooks are present to allow testing, by adding
<script type="text/javascript">_TrEventBasedValidation=true;</script>
to top of page.

Modified:
    myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js

Modified: myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js?rev=570531&r1=570530&r2=570531&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js (original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Core.js Tue Aug 28 12:09:29 2007
@@ -99,6 +99,9 @@
 var _TrFocusRequestID = null;
 var _TrFocusRequestNext = false;
 
+// Flag to indicate if inline validation is event based.
+var _TrEventBasedValidation = false;
+
 // _checkUnload is set on our body tag and is called when the window
 // unloads. In our dialog windows, we call _checkUnload via an intermediary
 // function _unloadADFDialog to work around Google's pop-up blocker
@@ -2189,6 +2192,16 @@
 
     // Stash the descriptor on the validator map
     validatorMap[id] = descriptor;
+
+    // If enabled, setup event based validation
+    if (_TrEventBasedValidation)
+    {
+      var inputElem = _getElementById(document, id);
+      if (inputElem)
+      { 
+        _addEvent(inputElem, "change", _validateInput);
+      }
+    }
   }
 
   // And store the new validator map away