Check that your Environment hasn't been cloaked().

During an Ajax call, when the phase switches from the action phase to
a render phase, the Env is `cloaked` effectively hiding all the stuff
previously put into the Env. This is new in 5.3 - quite annoying
really!

I added some hacky code to one project which, if pop() or peek()
returned null, I'd recursively decloak the Env until I found it. Then
re-cloak!

This may or may not be what you're running into.

Steve.

On 11 July 2012 04:18, Lance Java <[email protected]> wrote:
> I'm doing some very non standard stuff in tapestry-cometd where I need to
> invoke tapestry's templating in an async thread. I do this by creating a
> spoof request and response and setting RequestGlobals before invoking
> ComponentRequestHandler.handleComponentEvent(ComponentEventRequestParameters).
> This works well and I'm able to get a JSONObject with a "content" which
> contains the html.
>
> I'm now trying to support executing scripts added via JavaScriptSupport and
> I'm running into troubles where a JavaScriptSupport instance is not
> available in the Environment.
>
> I was hoping that everything would just work but apparently I need to setup
> the environment. Can any tapestry experts out there give me some advice on
> what I'm missing and where I should copy / paste from? I'm hoping to get a
> JSONObject with a "scripts" property that contains the scripts added via
> JavaScriptSupport.
>
> The service which does the magic is here
> https://github.com/uklance/tapestry-cometd/blob/master/src/main/java/org/lazan/t5/cometd/services/internal/ComponentJsonRendererImpl.java
>
> Cheers,
> Lance.
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Async-process-ComponentRequestHandler-and-JavaScriptSupport-tp5714401.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

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

Reply via email to