Author: jkuhnert
Date: Sun Jun 24 12:03:11 2007
New Revision: 550276

URL: http://svn.apache.org/viewvc?view=rev&rev=550276
Log:
Fixes small client id generation bug Andy found in IfBean that was causing it 
to render the same id for every iteration in a loop. (AbstractFormComponent 
defines its own clientid generation logic for handling forms and IfBean extends 
AbstractFormComponent )

Modified:
    
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/IfBean.java

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/IfBean.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/IfBean.java?view=diff&rev=550276&r1=550275&r2=550276
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/IfBean.java
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/IfBean.java
 Sun Jun 24 12:03:11 2007
@@ -104,7 +104,21 @@
 
         cycle.setAttribute(IF_VALUE_ATTRIBUTE, new Boolean(_conditionValue));
     }
-    
+
+    /**
+     * Overriden from [EMAIL PROTECTED] AbstractFormComponent} to handle cases 
where
+     * we're not being wrapped by a [EMAIL PROTECTED] IForm} component.
+     *
+     * <p>This is basically a copy of the same method implemented in [EMAIL 
PROTECTED] AbstractComponent}.</p> 
+     */
+    protected void generateClientId()
+    {
+        String id = getSpecifiedId();
+
+        if (id != null && getPage() != null && getPage().getRequestCycle() != 
null)
+             
setClientId(getPage().getRequestCycle().getUniqueId(TapestryUtils.convertTapestryIdToNMToken(id)));
+    }
+
     protected boolean evaluateCondition(IRequestCycle cycle, IForm form, 
boolean cycleRewinding)
     {
         boolean condition;


Reply via email to