IF component's condition expression get evaluated 3 or more times when it 
should only be evaluated once.
--------------------------------------------------------------------------------------------------------

                 Key: TAPESTRY-1477
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1477
             Project: Tapestry
          Issue Type: Bug
          Components: Core Components
    Affects Versions: 4.1.2
         Environment: At least since 4.1.2-20070501.233137-64, but an old 
4.1.2-20070215.051249-15 worked correctly.
Java 1.5, Tomcat 5.5.23 (should not matter), caching off.  IE 6 and Firefox 2 
on XP Pro.
            Reporter: Daniel Jue
             Fix For: 4.1.2


I've simplified the problem code even
more, to eliminate any confusion:

plain.java:
package com.phy6.app;

import org.apache.tapestry.IComponent;
import org.apache.tapestry.annotations.Component;
import org.apache.tapestry.annotations.InitialValue;
import org.apache.tapestry.html.BasePage;

public abstract class plain extends BasePage {

       public boolean getDoStuff() {
               this.setNumber(this.getNumber() + 1);
               System.out.println("plain: getDoStuff() " + this.getNumber());
               return false;
       }

       @Component(type = "If", id = "ifXYZ", bindings = {
               "condition=getDoStuff()" })
       public abstract IComponent getIfXYZ();

       @InitialValue("0")
       public abstract int getNumber();

       
@Component(type="Insert",id="wtfisgoingon",bindings={"value=getNumber()"})
       public abstract IComponent getWTFisgoingon();
       public abstract void setNumber(int n);
}


plain.html:

<html>
<body>
<span jwcid="ifXYZ">Hi</span>
<span jwcid="wtfisgoingon" />
</body>
</html>

plain.page is still an empty page spec.

Same output:

May 17, 2007 1:57:40 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5328 ms
plain: getDoStuff() 1
plain: getDoStuff() 2
plain: getDoStuff() 3


Expected output:
plain: getDoStuff() 1

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to