myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hno...@apache.org
Subject [myfaces-tobago] branch master updated: tc:selectBooleanCheckbox: itemLabel with accessKey
Date Wed, 18 Mar 2020 08:23:24 GMT
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new ce10b69  tc:selectBooleanCheckbox: itemLabel with accessKey
ce10b69 is described below

commit ce10b69bbe678f489ad6a780d049bc33172c0d01
Author: Jasmin Kroeger <jasmin.kroeger@irian.eu>
AuthorDate: Tue Mar 17 17:54:27 2020 +0100

    tc:selectBooleanCheckbox: itemLabel with accessKey
    
    The accessKey is shown on the label by default. But if only an itemLabel is set, the accessKey
is shown on the itemLabel.
    itemLabel works also for tc:selectBooleanToggle
    
    Issue: TOBAGO-1666
---
 .../internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java
index 920559b..1c6fa2f 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectBooleanCheckboxRenderer.java
@@ -128,7 +128,11 @@ public class SelectBooleanCheckboxRenderer extends MessageLayoutRendererBase
{
     writer.writeClassAttribute(TobagoClass.INPUT_PSEUDO);
     writer.endElement(HtmlElements.I);
 
-    if (itemLabel != null) {
+    if (itemLabel != null && select.getLabel() == null && select.getAccessKey()
!= null) {
+      if (itemLabel.contains(Character.toString(select.getAccessKey()))) {
+        HtmlRendererUtils.writeLabelWithAccessKey(writer, label);
+      }
+    } else if (itemLabel != null) {
       writer.writeText(itemLabel);
     }
   }


Mime
View raw message