Hello,

I'm facing a strange behaviour on a component. Here if a sample component :

package tapestry.components;

import org.apache.tapestry5.MarkupWriter;

public class CountComponent {

    private Integer count = 0;

    public Integer getCount() {
        if (count == null) {
            count = 1;
        } else {
            count++;
        }
        return count;
    }

    public void beginRender(MarkupWriter writer) {
        writer.element("span");
        writer.write("->" + getCount().toString());
        writer.end();
    }

}

if if call mutliple type my component like :

<t:countComponent />
<t:countComponent />

I got the wanted behavior :

-> 1
-> 1

But if i nest my component into a loop like :

<t:loop source="items" value="var:item">
    <t:countComponent />
</t:loop>

I got this behaviour :

-> 1
-> 2
etc..

Is this intended or a bug ?

Best regards

Nicolas.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to