This has changed "For The Greater Good".  I don't think it can be
changed back or made optional in any reasonable way.

The specific case being handled was to deal with form submissions that
want to immediately render a response that includes a form ... without
cloaking the Environment, the FormSupport inside the environment would
cause an error when a Form started to render.

The fact that what you wrote worked is a problem, in that you do not
balance the environment, but rely on it being discarded even though
not everything pushed onto it was later popped.

Perhaps you could return a Block containing:

<t:block id="renderWithEnvironment">
  <t:trigger event="setupEnvironment"/>
  <t:delegate to="blockToRender"/>
  <t:trigger event="cleanupEnvironment"/>
</t:block>

This would allow Tapestry to just render your block; inside your
block, the setupEnvironment event would be where you would push into
the environment; the blockToRender would be the value you'd normally
return from your onAction() event handler method.  The
cleanupEnvironment event would be used to pop the value out of the
environment.

Thoughts?


On Tue, Jan 3, 2012 at 2:25 AM, jsauer <[email protected]> wrote:
> Hello,
>
> we're currently updating Tapestry from 5.2.6 to 5.3.1 and we're running into
> the exact same problem as this message from November described:
>
>
> Denis Stepanov-2 wrote
>>
>> Second, ajax request will lose environments set in its action method:
>>
>>     Object onAction(EventContext context)
>>     {
>>       environment.push(...);
>>         return myBlock; // environment is cloaked while rendering myBlock
>>     }
>>
>> myBlock is a block from a different page, which uses the environment as a
>> way how to communicate, concept similiar to the BeanEditor and its
>> contributions.
>>
>
> We also use the environment to pass parameters between the main page and
> contributed blocks. This works fine as long as the contributed blocks aren't
> rendered via Ajax (for example when using ProgressiveDisplay). As there's no
> documentation of any change like this in the release notes, I'd consider
> this a bug as well.
>
> Are there any plans to change this behaviour or any suggestions for a
> solution?
>
> regards
> Joachim Sauer
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/5-3-Too-much-environment-cloaking-bug-tp5005584p5116592.html
> Sent from the Tapestry - Dev mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to