This came in around T5.3, I believe the cloak / de-cloak was put in
for Ajax requests so the environment used in the action phase didn't
leak into the render phase.

Steve.

On 25 January 2013 01:31, Lance Java <lance.j...@googlemail.com> wrote:
> Considering the simplified example below, can someone please tell me why the
> environmental peekable for a page render request but not peekable for an
> ajax event? Upon debugging, I have found that if I decloak() the
> environment, I can then peek() the model.
>
> Page.tml
> ======
> <t:myComponent>
>    <t:subComponent />
> </t:myComponent>
>
> MyComponent.tml
> =============
> <t:zone t:id="zone">
>
>
>    <t:delegate to="componentResources.body" />
>
>    <t:eventlink event="doIt" zone="^">Do It</t:eventlink>
> </t:zone>
>
> MyComponent.java
> ==============
>    @Inject Environment environment;
>    @InjectComponent Zone zone;
>    void onActivate() {
>       environment.push(SomeModel.class, new SomeModelImpl());
>    }
>
>    Block onDoIt() {
>       environment.push(SomeModel.class, new SomeModelImpl());
>       return zone.getBody();
>    }
>
> MySubComponent.java
> =================
>    @Inject Environment environment;
>
>    void setupRender() {
>       SomeModel model = environment.peek(SomeModel.class); // this works for
> the non-ajax request
>       if (model == null) { // model is null for my ajax event
>          environment.decloak(); // this causes all sorts of problems further
> down the line
>          model = environment.peek(SomeModel.class); // this returns my model
> for the ajax event
>       }
>    }
>
>
>
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/5-4-alpha-2-Environment-cloaked-during-ajax-component-event-tp5719496.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>

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

Reply via email to