You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2007/07/10 11:32:59 UTC
svn commit: r554881 -
/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java
Author: lofwyr
Date: Tue Jul 10 02:32:58 2007
New Revision: 554881
URL: http://svn.apache.org/viewvc?view=rev&rev=554881
Log:
TOBAGO-433: disabled ignored
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?view=diff&rev=554881&r1=554880&r2=554881
==============================================================================
--- 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 Tue Jul 10 02:32:58 2007
@@ -24,7 +24,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
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;
@@ -34,6 +33,7 @@
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
import org.apache.myfaces.tobago.renderkit.html.HtmlRendererUtil;
+import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.NamingContainer;
@@ -115,7 +115,7 @@
writer.writeIdAttribute(id);
String formattedValue = RenderUtil.getFormattedValue(facesContext, component, item.getValue());
writer.writeAttribute(HtmlAttributes.VALUE, formattedValue, true);
- writer.writeAttribute(HtmlAttributes.DISABLED, ComponentUtil.getBooleanAttribute(component, ATTR_DISABLED));
+ writer.writeAttribute(HtmlAttributes.DISABLED, item.isDisabled());
writer.writeAttributeFromComponent(HtmlAttributes.TITLE, ATTR_TIP);
if (!ComponentUtil.getBooleanAttribute(component, ATTR_REQUIRED)) {
writer.writeAttribute(HtmlAttributes.ONCLICK, "Tobago.selectOneRadioClick(this, '" + clientId + "')", false);
@@ -124,7 +124,6 @@
if (item.getLabel() != null) {
-
if (!inline) {
writer.endElement(HtmlConstants.TD);
writer.startElement(HtmlConstants.TD, null);
@@ -134,7 +133,13 @@
// FIXME: use created UIOutput Label
// FIXME: see outcommented part
writer.startElement(HtmlConstants.LABEL, null);
- writer.writeClassAttribute("tobago-label-default");
+ // todo: use label component with a "light" markup
+ StyleClasses styleClasses = new StyleClasses();
+ styleClasses.addAspectClass("label", StyleClasses.Aspect.DEFAULT);
+ if (item.isDisabled()) {
+ styleClasses.addAspectClass("label", StyleClasses.Aspect.DISABLED);
+ }
+ writer.writeClassAttribute(styleClasses);
writer.writeAttribute(HtmlAttributes.FOR, id, false);
writer.writeText(item.getLabel());
writer.endElement(HtmlConstants.LABEL);