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 2011/04/05 21:35:05 UTC

svn commit: r1089173 - 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/java/org/apache/myfaces/tobago/renderkit/html/util/

Author: bommel
Date: Tue Apr  5 19:35:04 2011
New Revision: 1089173

URL: http://svn.apache.org/viewvc?rev=1089173&view=rev
Log:
(TOBAGO-989) Avoid calling getClientId if tabGroup is transient

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/CommandRendererHelper.java

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.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/ToolBarRendererBase.java?rev=1089173&r1=1089172&r2=1089173&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRendererBase.java Tue Apr  5 19:35:04 2011
@@ -231,7 +231,7 @@ public abstract class ToolBarRendererBas
       return width;
     }
 
-    final String clientId = command.getClientId(facesContext);
+    //final String clientId = command.getClientId(facesContext);
     final boolean disabled = ComponentUtils.getBooleanAttribute(command, Attributes.DISABLED);
     final LabelWithAccessKey label = new LabelWithAccessKey(command);
     final AbstractUIMenu dropDownMenu = FacetUtils.getDropDownMenu(command);
@@ -386,7 +386,9 @@ public abstract class ToolBarRendererBas
     writer.startElement(HtmlElements.SPAN, command);
     writer.writeClassAttribute(Classes.create(toolBar, "button", selected ? Markup.SELECTED : Markup.NULL));
     writer.writeStyleAttribute(buttonStyle);
-    writer.writeIdAttribute(command.getClientId(facesContext));
+    if (!toolBar.isTransient()) {
+      writer.writeIdAttribute(command.getClientId(facesContext));
+    }
     writer.writeAttribute(HtmlAttributes.ONCLICK, commandClick != null ? commandClick : menuClick, true);
     // render icon
     if (showIcon && iconName != null) {

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/CommandRendererHelper.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/CommandRendererHelper.java?rev=1089173&r1=1089172&r2=1089173&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/CommandRendererHelper.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/CommandRendererHelper.java Tue Apr  5 19:35:04 2011
@@ -68,7 +68,6 @@ public class CommandRendererHelper {
         }
       }
 
-      String clientId = command.getClientId(facesContext);
       boolean defaultCommand = ComponentUtils.getBooleanAttribute(command, Attributes.DEFAULT_COMMAND);
       boolean transition = ComponentUtils.getBooleanAttribute(command, Attributes.TRANSITION);
 
@@ -85,7 +84,7 @@ public class CommandRendererHelper {
       } else if (StringUtils.isNotEmpty(command.getOnclick())) {
         onclick = prepareOnClick(facesContext, command);
       } else if (command.getRenderedPartially().length > 0) {
-
+        String clientId = command.getClientId(facesContext);
         String[] componentIds = command.getRenderedPartially();
 
         // TODO find a better way
@@ -103,9 +102,11 @@ public class CommandRendererHelper {
         }
 
       } else if (defaultCommand) {
+        String clientId = command.getClientId(facesContext);
         ComponentUtils.findPage(facesContext, command).setDefaultActionId(clientId);
         onclick = null;
       } else {
+        String clientId = command.getClientId(facesContext);
         String target = ComponentUtils.getStringAttribute(command, Attributes.TARGET);
         if (target == null) {
           onclick = "Tobago.submitAction(this, '" + clientId + "', " + transition + ");";