o:deferredScript fails during postback of a stateless view #45

Closed
BalusC opened this Issue Jul 11, 2014 · 3 comments

Projects

None yet

1 participant

@BalusC
Member
BalusC commented Jul 11, 2014

When performing a postback in a stateless view (f:view transient="true"), then DeferredScript#processEvent() isn't invoked for PostAddToView event. Ultimately, the o:deferredScript still sticks in head instead of body and subsequently CombinedResourceHandler isn't able to find it.

@BalusC
Member
BalusC commented Jul 11, 2014

o:onloadScript has same problem.

@BalusC BalusC added a commit that closed this issue Dec 23, 2014
@BalusC BalusC Fix #45 DeferredScript/OnloadScript fail in stateless views. Tested in
Mojarra 2.2.9 / MyFaces 2.2.6 with all combinations of f:view
transient="true|false", f:ajax render="@all" or not, with/out
CombinedResourceHandler.
4181063
@BalusC BalusC closed this in 4181063 Dec 23, 2014
@BalusC
Member
BalusC commented Dec 23, 2014

Fixed.

I discovered that <o:onloadScript> (and subsequently <o:highlight>) in a stateless view didn't trigger PostRestoreStateEvent at all during ajax postbacks when using MyFaces 2.2.6. All works fine in Mojarra 2.2.9. Needs further investigation if this is a MyFaces bug or not.

@BalusC
Member
BalusC commented Dec 30, 2014

I also discovered that <o:deferredScript> wasn't properly relocated in view in a stateless view during postback when using Mojarra 2.2.8 (and possibly older). This is only noticeable when there are multiple <o:deferredScript> components (at least 3) in the view. It seems that view build time actions (relocation of resource component) aren't properly remembered and re-applied during restore view. All works fine in Mojarra 2.2.9.

@BalusC BalusC added a commit that referenced this issue Jan 12, 2015
@BalusC BalusC Fix #45 DeferredScript/OnloadScript fail in stateless views. Tested in
Mojarra 2.2.9 / MyFaces 2.2.6 with all combinations of f:view
transient="true|false", f:ajax render="@all" or not, with/out
CombinedResourceHandler.
7038c17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment