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 2012/09/11 11:13:17 UTC

svn commit: r1383305 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/util/ tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/

Author: lofwyr
Date: Tue Sep 11 09:13:17 2012
New Revision: 1383305

URL: http://svn.apache.org/viewvc?rev=1383305&view=rev
Log:
correct name of method

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java?rev=1383305&r1=1383304&r2=1383305&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java Tue Sep 11 09:13:17 2012
@@ -1034,7 +1034,11 @@ public class ComponentUtils {
     return ArrayUtils.EMPTY_STRING_ARRAY;
   }
 
-  public static void putDataAttributeWithSuffix(UIComponent component, String name, Object value) {
+  /**
+   * Adding a data attribute to the component. 
+   * The name must start with "data-", e. g. "data-tobago-foo" or "data-bar"
+   */
+  public static void putDataAttributeWithPrefix(UIComponent component, String name, Object value) {
     if (name.startsWith("data-")) {
       putDataAttribute(component, name.substring(5), value);
     } else {
@@ -1042,6 +1046,10 @@ public class ComponentUtils {
     }
   }
 
+  /**
+   * Adding a data attribute to the component.
+   * The name should not start with "data-", e. g. "tobago-foo" or "bar"
+   */
   public static void putDataAttribute(UIComponent component, Object name, Object value) {
     Map<Object, Object> map = (Map<Object, Object>) component.getAttributes().get(DATA_ATTRIBUTES_KEY);
     if (map == null) {

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.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/DatePickerRenderer.java?rev=1383305&r1=1383304&r2=1383305&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DatePickerRenderer.java Tue Sep 11 09:13:17 2012
@@ -138,7 +138,7 @@ public class DatePickerRenderer extends 
         facesContext, UIButton.COMPONENT_TYPE, RendererTypes.BUTTON, "ok");
     buttonPanel.getChildren().add(okButton);
     FacesUtils.setBindingOrExpression(okButton, Attributes.LABEL, "#{tobagoContext.resourceBundle.datePickerOk}");
-    ComponentUtils.putDataAttributeWithSuffix(okButton, DataAttributes.DATEPICKEROK, true);
+    ComponentUtils.putDataAttributeWithPrefix(okButton, DataAttributes.DATEPICKEROK, true);
     okButton.getAttributes().put(Attributes.POPUP_CLOSE, "afterSubmit");
     okButton.getAttributes().put(Attributes.ONCLICK, "/* fixme: avoid submit */");
     final UIButton cancelButton = (UIButton) CreateComponentUtils.createComponent(