cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jheym...@apache.org
Subject svn commit: r306638 - /cocoon/blocks/forms/trunk/samples/dreamteam/flow/team.js
Date Thu, 06 Oct 2005 13:28:00 GMT
Author: jheymans
Date: Thu Oct  6 06:27:56 2005
New Revision: 306638

URL: http://svn.apache.org/viewcvs?rev=306638&view=rev
Log:
fixes http://issues.apache.org/bugzilla/show_bug.cgi?id=31813

Modified:
    cocoon/blocks/forms/trunk/samples/dreamteam/flow/team.js

Modified: cocoon/blocks/forms/trunk/samples/dreamteam/flow/team.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/dreamteam/flow/team.js?rev=306638&r1=306637&r2=306638&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/dreamteam/flow/team.js (original)
+++ cocoon/blocks/forms/trunk/samples/dreamteam/flow/team.js Thu Oct  6 06:27:56 2005
@@ -123,17 +123,22 @@
   print("memberId changed from " + event.oldValue + " to " + event.newValue);
   var value = event.source.value;
   var form = event.source.form;
-  var everyone = form.getAttribute("everyone");
-  var position = event.source.lookupWidget("../position").value;
-  var team = everyone.get(position);
-  var member = team.getMember(value);
-  if (member != null) {
-    var country = member.getCountry();
-    var countrywidget = event.source.lookupWidget("../country");
-    countrywidget.setValue(country);
+  if (form != null){
+    var everyone = form.getAttribute("everyone");
+    if (everyone != null){
+      var position = event.source.lookupWidget("../position").value;
+      if (position != null){
+        var team = everyone.get(position);
+        var member = team.getMember(value);
+        if (member != null) {
+          var country = member.getCountry();
+          var countrywidget = event.source.lookupWidget("../country");
+          countrywidget.setValue(country);
+        }
+      }
+    }
   }
 }
-
 function updateRowIDcounter(event) {
   // Increment the row creation ID counter
   // (it has been initialized in the flowscript when the



Mime
View raw message