tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alejandro Scandroli <alejandroscandr...@gmail.com>
Subject Re: Let's fix Environment state
Date Mon, 07 Jan 2013 14:28:43 GMT
Here is my use case fwiw.
I was using a couple of block contributions that used components that
used AJAX, and they all stopped working after introducing the
cloak/decloak feature.
The main one was a really handy component for automatically rendering
a composition relationship between two entities [1]

I really have no clue on how to fix it but I'll love to have it
working again. Thanks Denis for bringing this up for discussion.

[1] https://svn.codehaus.org/tynamo/trunk/tapestry-model/tapestry-model-core/src/main/resources/org/tynamo/components/internal/Composition.tml

Alejandro.



On Fri, Jan 4, 2013 at 10:31 PM, Howard Lewis Ship <hlship@gmail.com> wrote:
> An alternative would be to re-architect how Ajax operations operate, so
> that the invocation stack would unwind out pretty far (past where any
> environmentals would have been set up) and then kick off the partial page
> rendering at that point.
>
>
> On Fri, Jan 4, 2013 at 11:28 AM, Denis Stepanov <denis.stepanov@gmail.com>wrote:
>
>> 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.
>>
>> Denis
>>
>> 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
>>
>>
>
>
> --
> 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


Mime
View raw message