If I got the right meaning of "rendered as part of a component" this should be equivalent to:

<tr:somePPRTarget partialTriggers="trigger1 trigger2 ...">
    ....
    <script type="text/_javascript_">
        alert('Script run after PPR')
    </script>
</tr:somePPRTarget>

Correct ?

-- Renzo

Danny Robinson wrote:
Sample:

    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExtendedRenderKitService service = (ExtendedRenderKitService)
      Service.getRenderKitService(facesContext, ExtendedRenderKitService.class );
    service.addScript(facesContext, "alert('Script added by ExtendedRenderKitService')");


On 8/9/07, Renzo Tomaselli < [EMAIL PROTECTED]> wrote:
Great ! Your statement makes less important to hook into PPR completion by some dedicated js api, since this will be possible in any case by including some js snippet in a target region.

-- Renzo


Adam Winer wrote:
In fact, in 1.0.2, scripts that are rendered as part of a
component or via ExtendedRenderKitService *will* get
executed, and exactly once, in the proper context
(the parent document).  Anything added via

ExtendedRenderKitService will get rendered after
all of the other PPR contents.

We'll also dynamically load any JS libraries that are
rendered out - <script src=""/> will turn into

a subsequent AJAX request for that script library,
and its execution, unless the library is already loaded
on the browser.

-- Adam


On 8/9/07, Danny Robinson 
<[EMAIL PROTECTED]> wrote:
  
Renzo,

I suggest you don't count on this behaviour, as the 1.0.2 release due any
time soon switches to using AJAX rather than the _pprIFrame.  This means
your script won't get executed at all in IE, and once in Firefox.  There's

talk of some hooks into the AJAX routines to provide hooks when updates
occur to certain elements of the page, however there's a generic hook for
pre-and-post AJAX calls already in 1.0.2.

AJAX powered PPR details are available here:


http://myfaces.apache.org/trinidad/devguide/ppr.html

Perhaps someone else can shed some light on a reliable mechanism to have
script snippets executed on PPR completion.

Danny.


On 8/9/07, Renzo Tomaselli <[EMAIL PROTECTED]> wrote:
    
Hi, I noticed a strong asymmetry while executing a js block included
into a PPR target: on IE this runs once, in the context of _pprIFrame.
On FF it runs twice, once in the context of _pprIFrame and then in the

context of the original page, after PPR modifications have been applied
to the dom.
While on FF this behavior offers a full suite of tuning opportunities to
play with PPR contents, on IE the game is severely constrained.

Is that a bug to hunt for, a side-effect or a wanted feature ?
Thanks,

-- Renzo


      
--
Chordiant Software Inc.
www.chordiant.com
    
  



--
Chordiant Software Inc.
www.chordiant.com

Reply via email to