[gatein-commits] gatein SVN: r5100 - exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/gadget.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Nov 16 02:22:57 EST 2010


Author: kien_nguyen
Date: 2010-11-16 02:22:57 -0500 (Tue, 16 Nov 2010)
New Revision: 5100

Modified:
   exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
Log:
EXOGTN-169 [PLF] Gadgets : UserPrefs bool type doesnt render a checkbox

Modified: exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
===================================================================
--- exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js	2010-11-16 07:04:38 UTC (rev 5099)
+++ exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js	2010-11-16 07:22:57 UTC (rev 5100)
@@ -669,6 +669,17 @@
             }
             attEl.appendChild(el);
         }
+        else if (type == "bool") {
+            var el = document.createElement("input");
+            el.type = "checkbox";
+            el.name = prefix + att;
+            el.id = elID;
+            if ((userPrefs[att] && userPrefs[att] == "true") ||
+            		prefs[att]["default"] == "true") {
+                el.checked = true;
+            }
+            attEl.appendChild(el);
+        }
         formEl.appendChild(attEl);
         j++;
     }
@@ -745,6 +756,8 @@
       var userPrefNamePrefix = 'm_' + this.id + '_up_';
       var userPrefName = input.name.substring(userPrefNamePrefix.length);
       var userPrefValue = input.value;
+      if(input.type == 'checkbox')
+    	  userPrefValue = input.checked ? "true" : "false";
       prefs[userPrefName] = userPrefValue;
     }
   }



More information about the gatein-commits mailing list