Ok, I guess I figured out the reason, which causes the solution suggested on 
the Wiki page to fail:
In our web application class StreamingAddResource is configured to be used to 
add resources like JavaScript, CSS etc. to the response, which attempts to 
write any resource immediately to the response writer. The DefaultAddResource 
class instead holds a set for each supported resource position wherein all 
added resources are kept until they are rendered on completion of the render 
response phase. So later implementation only allows to control popup triggering 
within the invoke application phase!

Regards,
CAK  

-----Ursprüngliche Nachricht-----
Von: Carsten Kaiser [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 28. März 2007 06:10
An: MyFaces Discussion
Betreff: AW: How to add inline javascript in application phase?

Hello Simon,

thank you very much for his hint. I really could have thought about 
looking for any other value of resource position! I will give it a try! 
Hope, that BODY_ONLOAD will not ask for the ResponseWriter...

Regards,
CAK



-- 
Carsten Kaiser
Principal Consultant
mailto:[EMAIL PROTECTED]
Mobile: +49 (0)170 5270206

Valtech GmbH
Werner-Heisenberg-Straße 2
63263 Neu-Isenburg
Germany

Phone: +49 (0)6102 88468-0
Fax: +49 (0)6102 88468-28

http://www.valtech.de

Geschäftsführer: Ingo Kriescher
Amtsgericht Düsseldorf HRB48672




-----Ursprüngliche Nachricht-----

Von: Simon Kitching [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 28. März 2007 05:31
An: MyFaces Discussion
Betreff: Re: How to add inline javascript in application phase?

Mike Kienenberger wrote:
> On 3/27/07, Carsten Kaiser <[EMAIL PROTECTED]> wrote:
>> But I'm still interested in getting some statement concerning the
>> description on the Wiki page referenced above.
>
> Edit it :-)

I think Carsten is asking for an explanation of the example code.

After looking at it, I'm not sure why Carsten was getting the original
exception re no response-writer. I hadn't read the code carefully enough
and was assuming that AddResource.addJavascriptInline was writing it out
immediately. However the method takes a "ResourcePosition" parameter of
value HEAD_BEGIN, and is simply adding that inline script to a set of
values to output later. So I'm not sure why the response stream would be
needed then.

By the way, Carsten, the resource position can also be BODY_ONLOAD which
is what you stated you wanted..

Regards,

Simon

Reply via email to