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 2020/08/12 14:41:31 UTC

[myfaces-tobago] branch TOBAGO-1999_Select2 updated: TOBAGO-2052 - doesn't support markup-attribute

This is an automated email from the ASF dual-hosted git repository.

weber pushed a commit to branch TOBAGO-1999_Select2
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/TOBAGO-1999_Select2 by this push:
     new 49a4dd4  TOBAGO-2052 - <tc:toolBarCommand> doesn't support markup-attribute
49a4dd4 is described below

commit 49a4dd455398ac3d755c64c4aea83b5da683ec83
Author: Volker Weber <v....@inexso.de>
AuthorDate: Wed Aug 12 16:40:33 2020 +0200

    TOBAGO-2052 - <tc:toolBarCommand> doesn't support markup-attribute
---
 .../html/standard/standard/tag/ToolBarRendererBase.java       | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRendererBase.java b/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRendererBase.java
index 64f1bb0..ba8b0d5 100644
--- a/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRendererBase.java
+++ b/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRendererBase.java
@@ -24,6 +24,7 @@ import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.component.SelectBooleanCommand;
 import org.apache.myfaces.tobago.component.SelectOneCommand;
 import org.apache.myfaces.tobago.component.SupportsAccessKey;
+import org.apache.myfaces.tobago.component.SupportsMarkup;
 import org.apache.myfaces.tobago.component.UIMenuSelectOne;
 import org.apache.myfaces.tobago.component.UIToolBar;
 import org.apache.myfaces.tobago.component.UIToolBarSeparator;
@@ -136,7 +137,9 @@ public abstract class ToolBarRendererBase extends LayoutComponentRendererBase {
 
     if (radio != null) {
       writer.startElement(HtmlElements.SPAN, radio);
-      writer.writeClassAttribute(Classes.createWorkaround("toolBar", "selectOne", null));
+      Markup itemMarkup
+          = radio instanceof SupportsMarkup ? ((SupportsMarkup) radio).getCurrentMarkup() : Markup.NULL;
+      writer.writeClassAttribute(Classes.createWorkaround("toolBar", "selectOne", itemMarkup));
       final Object value = radio.getValue();
 
       String currentValue = "";
@@ -204,7 +207,9 @@ public abstract class ToolBarRendererBase extends LayoutComponentRendererBase {
     final String clientId = checkbox.getClientId(facesContext);
 
     writer.startElement(HtmlElements.SPAN, checkbox);
-    writer.writeClassAttribute(Classes.createWorkaround("toolBar", "selectBoolean", null));
+    Markup itemMarkup
+        = checkbox instanceof SupportsMarkup ? ((SupportsMarkup) checkbox).getCurrentMarkup() : Markup.NULL;
+    writer.writeClassAttribute(Classes.createWorkaround("toolBar", "selectBoolean", itemMarkup));
     final CommandMap map = new CommandMap(new Command());
     width = renderToolbarButton(facesContext, toolBar, command, writer, checked, width, map, null);
 
@@ -370,7 +375,7 @@ public abstract class ToolBarRendererBase extends LayoutComponentRendererBase {
     
     // start rendering
     writer.startElement(HtmlElements.SPAN, command);
-    Markup itemMarkup = Markup.NULL;
+    Markup itemMarkup = command instanceof SupportsMarkup ? ((SupportsMarkup) command).getCurrentMarkup() : Markup.NULL;
     if (selected) {
       itemMarkup = itemMarkup.add(Markup.SELECTED);
     }