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 2012/06/23 08:10:15 UTC
svn commit: r1353071 -
/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java
Author: bommel
Date: Sat Jun 23 06:10:15 2012
New Revision: 1353071
URL: http://svn.apache.org/viewvc?rev=1353071&view=rev
Log:
(TOBAGO-1162)
Missing accessKey support in tc:selectBooleanCheckbox
Modified:
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.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/SelectBooleanCheckboxRenderer.java?rev=1353071&r1=1353070&r2=1353071&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java Sat Jun 23 06:10:15 2012
@@ -19,6 +19,8 @@ package org.apache.myfaces.tobago.render
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UISelectBooleanCheckbox;
+import org.apache.myfaces.tobago.internal.util.AccessKeyMap;
+import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
@@ -109,10 +111,18 @@ public class SelectBooleanCheckboxRender
label = select.getLabel(); // compatibility since TOBAGO-1093
}
if (label != null) {
+ LabelWithAccessKey labelWithAccessKey = new LabelWithAccessKey(label);
writer.startElement(HtmlElements.LABEL, select);
writer.writeAttribute(HtmlAttributes.FOR, id, false);
- writer.writeText(label);
+ HtmlRendererUtils.writeLabelWithAccessKey(writer, labelWithAccessKey);
writer.endElement(HtmlElements.LABEL);
+ if (labelWithAccessKey.getAccessKey() != null) {
+ if (LOG.isInfoEnabled()
+ && !AccessKeyMap.addAccessKey(facesContext, labelWithAccessKey.getAccessKey())) {
+ LOG.info("duplicated accessKey : " + labelWithAccessKey.getAccessKey());
+ }
+ HtmlRendererUtils.addClickAcceleratorKey(facesContext, id, labelWithAccessKey.getAccessKey());
+ }
}
writer.endElement(HtmlElements.DIV);