> How you're adding these objects in the Environment? Please post the code that 
> does that.

My page, Test.tml:

<t:zone elementName="div" t:id="textzone">
        count:[ ${count} ] <t:embedComponent />
</t:zone>
<t:eventlink t:id="plusOne" zone="textzone">+1</t:eventlink>

Test.java:
...
        void setupRender() {
                env.push(String.class, "++" + this.count);
        }

        void afterRender() {
                env.pop(String.class);
        }

        Object onPlusOne() {
                if (count == null) {
                        count = 0;
                }
                this.count++;

                env.push(String.class, "++" + this.count); // I set 
environmental object here.

                return textzone;
        }
...

EmbedComponent.java:
...
        @Environmental
        @Property
        private String env;

EmbedComponent.tml:
...
${env}
...

The first time page render, setupRender and afterRender will be called, it 
works.
I click +1 button, the environmental object 'env' can not be found in component 
EmbedComponent.





On Nov 8, 2011, at 12:15 AM, Thiago H. de Paula Figueiredo wrote:

> On Mon, 07 Nov 2011 14:01:19 -0200, Bo Gao <eli...@gmail.com> wrote:
> 
>> I have a zone, and many nested components in it. I pass objects to these 
>> components by Environmental Service.
>> 
>> The first time page render is ok. But when I click an Action link which will 
>> refresh the zone, I can't get Environmental Object.
> 
> How you're adding these objects in the Environment? Please post the code that 
> does that.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br

--
Bo Gao
eli...@gmail.com

Reply via email to