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:29:33 UTC
svn commit: r734659 -
/myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java
Author: bommel
Date: Thu Jan 15 02:29:32 2009
New Revision: 734659
URL: http://svn.apache.org/viewvc?rev=734659&view=rev
Log:
(TOBAGO-739) Allow setting the id of field/input components in FaceletsExtensionTags with the fieldId Attribute
Modified:
myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java
Modified: myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java?rev=734659&r1=734658&r2=734659&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java (original)
+++ myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java Thu Jan 15 02:29:32 2009
@@ -59,6 +59,7 @@
private TagAttribute tipAttribute;
private TagAttribute labelAttribute;
private TagAttribute markupAttribute;
+ private TagAttribute fieldIdAttribute;
public TobagoLabelExtensionHandler(ComponentConfig config) {
super(config);
@@ -66,6 +67,7 @@
tipAttribute = getAttribute(Attributes.TIP);
labelAttribute = getAttribute(Attributes.LABEL);
markupAttribute = getAttribute(Attributes.MARKUP);
+ fieldIdAttribute = getAttribute("fieldId");
}
protected abstract String getSubComponentType();
@@ -108,7 +110,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;
}