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 2013/08/05 13:51:54 UTC

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

Author: weber
Date: Mon Aug  5 11:51:54 2013
New Revision: 1510438

URL: http://svn.apache.org/r1510438
Log:
TOBAGO-1291 - Dropdown Menu did not work on tabgroup Navigation

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

Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java?rev=1510438&r1=1510437&r2=1510438&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java Mon Aug  5 11:51:54 2013
@@ -250,19 +250,22 @@ public class TabGroupRenderer extends La
     UICommand previous = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
     previous.setRendererType(null);
     previous.getAttributes().put(Attributes.IMAGE, "image/tabPrev.gif");
-    previous.setOnclick("/**/"); // XXX avoid submit
+    previous.setOmit(true); // avoid submit
     // next
     UICommand next = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
     next.setRendererType(null);
     next.getAttributes().put(Attributes.IMAGE, "image/tabNext.gif");
-    next.setOnclick("/**/"); // XXX avoid submit
+    next.setOmit(true); // avoid submit
 
     // all: sub menu to select any tab directly
     UICommand all = (UICommand) CreateComponentUtils.createComponent(
         facesContext, UICommand.COMPONENT_TYPE, null, null);
+    all.setOmit(true); // avoid submit
+
     UIMenu menu = (UIMenu) CreateComponentUtils.createComponent(
         facesContext, UIMenu.COMPONENT_TYPE, RendererTypes.MENU, null);
     menu.setTransient(true);
+    ComponentUtils.addCurrentMarkup(menu, Markup.TOP);
     FacetUtils.setDropDownMenu(all, menu);
     int index = 0;
     for (UIComponent child : tabGroup.getChildren()) {
@@ -272,6 +275,7 @@ public class TabGroupRenderer extends La
           UIMenuCommand entry = (UIMenuCommand) CreateComponentUtils.createComponent(
               facesContext, UIMenuCommand.COMPONENT_TYPE, RendererTypes.MENU_COMMAND, null);
           entry.setTransient(true);
+          entry.setOmit(true); // avoid submit
           LabelWithAccessKey label = new LabelWithAccessKey(tab);
           entry.setLabel(label.getText());
           if (tab.isDisabled()) {

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js?rev=1510438&r1=1510437&r2=1510438&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js Mon Aug  5 11:51:54 2013
@@ -264,8 +264,10 @@ Tobago.Menu.switchOn = function(menuBar,
       .bind(compatibleKeyEvent(), Tobago.Menu.handelKey);
   var a = menu.children('a');
   if (! a.data("tobago-ignore-focus")) { // can be removed, after refactoring to a jQuery widget variable
-    if (menu.parents(".tobago-toolBar").size() == 0 && menu.parents(".tobago-box-headerToolBar").size() == 0
-        && menu.parents(".tobago-column-menu").size() == 0) {
+    if (menu.parents(".tobago-toolBar").size() == 0
+        && menu.parents(".tobago-box-headerToolBar").size() == 0
+        && menu.parents(".tobago-column-menu").size() == 0
+        && menu.parents(".tobago-tabGroupToolBar-menu").size() == 0) {
       a.trigger("focus");
     } else {
       // XXX the call in the previous line doesn't work with toolBar -> dropDown (don't know why), so using direct call