You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2007/06/24 21:03:12 UTC

svn commit: r550276 - /tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/IfBean.java

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 {@link AbstractFormComponent} to handle cases where
+     * we're not being wrapped by a {@link IForm} component.
+     *
+     * <p>This is basically a copy of the same method implemented in {@link 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;