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 2007/10/31 11:43:49 UTC

svn commit: r590618 - /myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java

Author: weber
Date: Wed Oct 31 03:43:49 2007
New Revision: 590618

URL: http://svn.apache.org/viewvc?rev=590618&view=rev
Log:
(TOBAGO-528) selectOneRenderer did not render disabled
<http://issues.apache.org/jira/browse/TOBAGO-503>

Modified:
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java?rev=590618&r1=590617&r2=590618&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java Wed Oct 31 03:43:49 2007
@@ -27,6 +27,7 @@
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_INLINE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_REQUIRED;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_TIP;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
 import org.apache.myfaces.tobago.component.ComponentUtil;
 import org.apache.myfaces.tobago.component.UISelectOne;
 import org.apache.myfaces.tobago.renderkit.RenderUtil;
@@ -95,6 +96,7 @@
       }
     }
 
+    boolean disabled = ComponentUtil.getBooleanAttribute(selectOne, ATTR_DISABLED);
     Object value = selectOne.getValue();
     List<String> clientIds = new ArrayList<String>();
     for (SelectItem item : items) {
@@ -118,7 +120,7 @@
       writer.writeIdAttribute(id);
       String formattedValue = RenderUtil.getFormattedValue(facesContext, selectOne, item.getValue());
       writer.writeAttribute(HtmlAttributes.VALUE, formattedValue, true);
-      writer.writeAttribute(HtmlAttributes.DISABLED, item.isDisabled());
+      writer.writeAttribute(HtmlAttributes.DISABLED, item.isDisabled() || disabled);
       Integer tabIndex = selectOne.getTabIndex();
       if (tabIndex != null) {
         writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
@@ -143,7 +145,7 @@
         // todo: use label component with a "light" markup
         StyleClasses styleClasses = new StyleClasses();
         styleClasses.addAspectClass("label", StyleClasses.Aspect.DEFAULT);
-        if (item.isDisabled()) {
+        if (item.isDisabled() || disabled) {
           styleClasses.addAspectClass("label", StyleClasses.Aspect.DISABLED);
         }
         writer.writeClassAttribute(styleClasses);