You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Renzo Tomaselli <re...@tecnotp.it> on 2007/08/09 11:33:57 UTC
[Trinidad] executing js during PPR
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
Re: [Trinidad] executing js during PPR
Posted by Adam Winer <aw...@gmail.com>.
On 8/9/07, Renzo Tomaselli <re...@tecnotp.it> wrote:
>
> 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 ?
Well, yes. Though I'd prefer the use of ExtendedRenderKitService
if this is some PPR-specific Javascript, or Javascript that is
connected to responding to a particular server-side FacesEvent. If it's
just Javascript that needs to be included with that block whenever its
rendered, then what you're describing is right.
-- Adam
>
> -- 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 < renzo.tomaselli@tecnotp.it> 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
> > <da...@gmail.com> 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 <re...@tecnotp.it> 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
Re: [Trinidad] executing js during PPR
Posted by Danny Robinson <da...@gmail.com>.
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 <re...@tecnotp.it> 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 <da...@gmail.com> <da...@gmail.com> 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 <re...@tecnotp.it> <re...@tecnotp.it> 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
Re: [Trinidad] executing js during PPR
Posted by Adam Winer <aw...@gmail.com>.
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 <da...@gmail.com> 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 <re...@tecnotp.it> 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
Re: [Trinidad] executing js during PPR
Posted by Matthias Wessendorf <ma...@apache.org>.
I merge it tomorrow
-Matthias
On 8/9/07, Adam Winer <aw...@gmail.com> wrote:
> Matthias, could you hold up until I get a chance to look
> at the reported problems with umlauts + PPR? I'd really
> like to make sure we don't have any major i18n problems
> in 1.0.2.
>
> -- Adam
>
>
> On 8/9/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > @102 release, I return tonight from a business trip, will deliver the
> > artifacts by tonight / tomorrow morning (those to vote on)
> >
> > -M
> >
> > On 8/9/07, Danny Robinson <da...@gmail.com> 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 <re...@tecnotp.it> 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
> >
> >
> > --
> > Matthias Wessendorf
> >
> > further stuff:
> > blog: http://matthiaswessendorf.wordpress.com/
> > mail: matzew-at-apache-dot-org
> >
>
--
Matthias Wessendorf
further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org
Re: [Trinidad] executing js during PPR
Posted by Adam Winer <aw...@gmail.com>.
Matthias, could you hold up until I get a chance to look
at the reported problems with umlauts + PPR? I'd really
like to make sure we don't have any major i18n problems
in 1.0.2.
-- Adam
On 8/9/07, Matthias Wessendorf <ma...@apache.org> wrote:
> @102 release, I return tonight from a business trip, will deliver the
> artifacts by tonight / tomorrow morning (those to vote on)
>
> -M
>
> On 8/9/07, Danny Robinson <da...@gmail.com> 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 <re...@tecnotp.it> 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
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> mail: matzew-at-apache-dot-org
>
Re: [Trinidad] executing js during PPR
Posted by Matthias Wessendorf <ma...@apache.org>.
@102 release, I return tonight from a business trip, will deliver the
artifacts by tonight / tomorrow morning (those to vote on)
-M
On 8/9/07, Danny Robinson <da...@gmail.com> 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 <re...@tecnotp.it> 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
--
Matthias Wessendorf
further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org
Re: [Trinidad] executing js during PPR
Posted by Danny Robinson <da...@gmail.com>.
So no script will ever get executed in the context of the AJAX request.
Unlike the pprIFrame (which caused the browser to actually parse and render
the whole page inside the hidden iframe, thus executing script also), an
AJAX request is simply a receive of some text content through a pipe with no
parsing or rendering of the content. The Trinidad PPR code receives the
content through the pipe and parses the chunks and replaces the various
elements in the page with these chunks. At this point the browser does
re-render those elements, but then I believe we're then at the mercy of the
browser implementation as to if it executes any script content or not.
On 8/9/07, Renzo Tomaselli <re...@tecnotp.it> wrote:
>
> Thanks Danny, meanwhile I wonder why we shouldn't expect for a js chunk
> included in a PPR target not to be executed at some point during the PPR
> cycle.
> Perhaps this is a matter of semantics, but I would expect the same
> rendering behavior as for full page rendering. I mean js should execute
> during PPR if part of a target.
> Why an included script shouldn't get executed at all in IE ? Is this part
> of Ajax specs (if any) to update dom but not to run js ?
>
> -- Renzo
>
>
>
> Danny Robinson 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* <re...@tecnotp.it> 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
Re: [Trinidad] executing js during PPR
Posted by Danny Robinson <da...@gmail.com>.
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 <re...@tecnotp.it> 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