JSF 2 Scriptmanager style functionality

Posted by CDSO1 on Stack Overflow See other posts from Stack Overflow or by CDSO1
Published on 2010-05-18T13:31:41Z Indexed on 2010/05/26 2:01 UTC
Read the original article Hit count: 341

Filed under:
|
|
|

I need to be able to add some javascript to all ajax postback responses (PartialViewContext.isAjaxRequest == true) but I am not succeeding with any implementation I try.

I have tried implementing a

PhaseListener

and adding my script using PartialResponseWriter.insert* to add eval blocks, as well as trying to add the script by creating a script element. (Results in CDATA cannot nest, or just invalid XML)

I have tried decorating PartialViewContextFactory to override the

PartialViewContext.processPartial

and add the script after the wrapped instance has processed it...

How should I go about adding sripts to an Ajax response? Something similar to what .NET has with Scriptmanager.registerClientScriptBlock preferably.

Thank you

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about decorator