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 2009/01/15 11:19:35 UTC

svn commit: r734657 - /myfaces/tobago/branches/tobago-1.0.x/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java

Author: bommel
Date: Thu Jan 15 02:19:34 2009
New Revision: 734657

URL: http://svn.apache.org/viewvc?rev=734657&view=rev
Log:
(TOBAGO-739) Allow setting the id of field/input components in FaceletsExtensionTags with the fieldId Attribute

Modified:
    myfaces/tobago/branches/tobago-1.0.x/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java

Modified: myfaces/tobago/branches/tobago-1.0.x/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java?rev=734657&r1=734656&r2=734657&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java Thu Jan 15 02:19:34 2009
@@ -57,6 +57,7 @@
   private TagAttribute tipAttribute;
   private TagAttribute labelAttribute;
   private TagAttribute markupAttribute;
+  private TagAttribute fieldIdAttribute;
 
   public TobagoLabelExtensionHandler(ComponentConfig config) {
     super(config);
@@ -64,6 +65,7 @@
     tipAttribute = getAttribute(TobagoConstants.ATTR_TIP);
     labelAttribute = getAttribute(TobagoConstants.ATTR_LABEL);
     markupAttribute = getAttribute(TobagoConstants.ATTR_MARKUP);
+    fieldIdAttribute = getAttribute("fieldId");
   }
 
   protected abstract String getSubComponentType();
@@ -106,7 +108,12 @@
     addGridLayout(faceletContext, panel, root);
 
     addLabel(faceletContext, panel, root);
-    String uid = root.createUniqueId();
+    String uid;
+    if (fieldIdAttribute !=  null) {
+      uid = fieldIdAttribute.getValue(faceletContext);
+    } else {
+      uid = root.createUniqueId();
+    }
     if (checkForAlreadyCreated(panel, uid)) {
       return;
     }