You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/03/14 19:04:19 UTC

svn commit: r518247 - in /myfaces/tobago/trunk/theme: scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/

Author: bommel
Date: Wed Mar 14 11:04:18 2007
New Revision: 518247

URL: http://svn.apache.org/viewvc?view=rev&rev=518247
Log:
(TOBAGO-322) tabs after a readonly tab are not accessible if switch type is tabReload

Modified:
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java?view=diff&rev=518247&r1=518246&r2=518247
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java Wed Mar 14 11:04:18 2007
@@ -162,7 +162,8 @@
             final String[] cmds = {
                 "new Tobago.TabGroup(",
                 "    '" + clientId + "', ",
-                "    '" + activeIndex + "');"
+                "    '" + activeIndex + "', ",
+                "    '" + component.getChildCount() + "');"
             };
             HtmlRendererUtil.writeScriptLoader(facesContext, new String[0], cmds);
           }

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js?view=diff&rev=518247&r1=518246&r2=518247
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js Wed Mar 14 11:04:18 2007
@@ -16,9 +16,10 @@
  */
 
 
-Tobago.TabGroup = function(tabGroupId, activeIndex, page) {
+Tobago.TabGroup = function(tabGroupId, activeIndex, size) {
   this.tabGroupId = tabGroupId,
-      this.activeIndex = activeIndex;
+  this.activeIndex = activeIndex;
+  this.size = size;
   this.activeTabId  = tabGroupId + '.' + activeIndex;
   LOG.debug("activeTabId : " + this.activeTabId);
 
@@ -44,7 +45,7 @@
       onComplete: Tobago.bind(this, "onComplete")
   };
 
-  LOG.debug("opnclomplete = " + this.options.onComplete);
+  LOG.debug("onComplete = " + this.options.onComplete);
 
   this.setUp();
 };
@@ -57,9 +58,11 @@
     var idPrefix = this.activeTabId + Tobago.SUB_COMPONENT_SEP;
 
 //    var htmlId = this.tabGroupId;
-    var anchor = Tobago.element(idPrefix + i++);
-    while (anchor) {
-      LOG.debug("observe tab " + anchor.id);
+    for (i = 0; i < this.size; i++) {
+
+      var anchor = Tobago.element(idPrefix + i);
+      if (anchor) {
+        LOG.debug("observe tab " + anchor.id);
 //      if (i != this.activeIndex) {
 //        Event.observe(anchor, "click", this.reload.bindAsEventListener(this));
 //      }
@@ -73,8 +76,8 @@
 //      };
 
 //      Tobago.addEventListener(anchor, "click", onClick);
-      Tobago.addBindEventListener(anchor, "click", this, "reload");
-      anchor = Tobago.element(idPrefix + i++);
+        Tobago.addBindEventListener(anchor, "click", this, "reload");
+      }
     }