tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Stepanov <denis.stepa...@gmail.com>
Subject Re: Let's fix Environment state
Date Fri, 04 Jan 2013 19:28:45 GMT
Well, when you push the environmental service in the RequestFilter and then the environment
is cloaked so you end up without your service during the ajax rendering.

* It used to work before 5.3
* Same code that works everywere else doesn't work during the ajax partial rendering

Yes, I can see why it has been added, some components check if there is a FormSupport available.

It could be solved in the different way by saving the state at the begining of the rendering,
pushing it to the environment, and then restoring it when rendering the partial response.
I would say that save+restore with a pointer to the state is a way to go, but requires a little
bit more work.

Right now, the only way for me to use it, is to copy the environment service.


Jan 4, 2013 v 6:48 PM, Howard Lewis Ship <hlship@gmail.com>:

> I don't see it as broken. Why do you feel it is broken. Use cases, not
> broad pronouncements, please.
> What drove this is the Form component; in an Ajax form submission, the Form
> puts the FormSupport object into the environment.  Then as a consequence of
> the Ajax render, it needs to partially render again ... my memory of this
> is faulty. I can't remember what drove the need to cloak  I think it was
> there were multiple unexpected things in the Environment, interacting
> poorly and the cloak approach was the clean way to approach the problem.
> On Fri, Jan 4, 2013 at 3:49 AM, Denis Stepanov <denis.stepanov@gmail.com>wrote:
>> I like the concept of Environment, but Howard did broke it by introducing
>> cloak/decloak. You would think you could just add new environmental service
>> in the filter or somewhere else and assume it would be available everywhere
>> during rendering of the request, but it is not true, cloaking will hide all
>> your services without warning, and you end up spending your time trying to
>> figure out why did it disappear.
>> The cloaking is only used in the AjaxPartialResponseRenderer, I assume it
>> is there to simulate "clean" request when rendering multiple ajax responses
>> in the one request.
>> I would say it is possible to replace the cloak/decloak functionality with
>> similiar save/restore functionality: instead of hiding the stack before
>> rendering a new response it would be better to restore the state of the
>> environment stack.
>> What do you think?
>> Denis
> -- 
> 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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org

View raw message