[ 
https://issues.apache.org/jira/browse/MYFACES-4043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15250932#comment-15250932
 ] 

Leonardo Uribe commented on MYFACES-4043:
-----------------------------------------

This topic has been studied a lot years ago. See: PostAddToViewEvent publishing 
conditions

http://markmail.org/message/37yvgcko7tgfbf4w

In resume, the intention behind PostAddToViewEvent is to add components or 
activate some actions after the component tree is built. When partial state 
saving is enabled, since it is necessary to create the "initial state" and then 
apply the "delta state", PostAddToViewEvent is called every time the component 
tree is built, and that means every request. But note that if the component is 
correctly implemented, it only should see one call over its lifetime.

When PSS is disabled, the component tree is restored fully, which means 
facelets algorithm does not need to create the initial state, and 
PostAddToViewEvent is not invoked. 

I think the bug is related to primefaces. Probably the component you mention is 
added using PostAddToViewEvent, but it is a transient component, so it is not 
saved later, and when MyFaces restore the tree, the component is not restored 
because the component information was not saved. 

I'll close this issue as invalid, because I'm 101% sure there is no problem in 
that part (there are some ACID junit tests already in MyFaces that test 
precisely this point) . 

> PostAddToViewEvent in RENDER_RESPONSE not fired on postback requests when 
> partial-state-saving is turned off
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-4043
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4043
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.2.9
>         Environment: OS:      Windows 10
> IDE:      Intellij
> Server: Tomcat 8.0.30/Wildfly 10
> JSF-lib: Primefaces 5.3
>            Reporter: Thomas Herzog
>
> We use priemfaces growl which is an component where message can be displayed. 
> This component  is marked with the interface AutoUpdatable, which means that 
> these components do not need to be included in response update ids explicitly 
> and can be added to the response automatically. This happens in the class 
> *org.primefaces.event.AutoUpdateComponentListener* where a *SystemEvent* is 
> observed. On postback request the growl will be added to the response update 
> ids if configured to do so.
> The problem is, that this listener is only called ones on initial get request 
> and not on the following postback request if partial-state-saving is turned 
> off. If partial-state-saving is turned on, then the listener gets called on 
> postback request too.
> It seems that the PostAddToViewEvent is not fired on postback request if 
> PartialStateSaving is turned off but will be fired if turned on.
> See the following link for an running example:
> https://github.com/Curecomp/myfaces-issues/tree/master/2.2.9/disabled_psv_post_add_view_event_not_fired



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to