Author: hlship
Date: Thu Apr 2 23:34:56 2009
New Revision: 761476
URL: http://svn.apache.org/viewvc?rev=761476&view=rev
Log:
TAP5-432: Allow setting the id of a FormFragment component
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java?rev=761476&r1=761475&r2=761476&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java
Thu Apr 2 23:34:56 2009
@@ -75,6 +75,14 @@
@Parameter(defaultPrefix = BindingConstants.LITERAL)
private String element;
+ /**
+ * If bound, then the id attribute of the rendered element will be this
exact value. If not bound, then a unique id
+ * is generated for the element.
+ */
+ @Parameter(name = "id", defaultPrefix = BindingConstants.LITERAL)
+ private String idParameter;
+
+
@Inject
private Environment environment;
@@ -123,7 +131,7 @@
String id = resources.getId();
- clientId = renderSupport.allocateClientId(id);
+ clientId = resources.isBound("id") ? idParameter :
renderSupport.allocateClientId(id);
hiddenFieldPositioner = new HiddenFieldPositioner(writer, rules);