<br><br><div class="gmail_quote">2010/3/29 Martin Marinschek <span dir="ltr">&lt;<a href="mailto:mmarinschek@apache.org">mmarinschek@apache.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">&gt;<br>
&gt; Now, the instants of time where PostAddToViewEvent is published are:<br>
&gt;<br>
&gt; - With Partial State Saving enabled<br>
&gt;<br>
&gt;    * When the view is build at first time.<br>
&gt;    * In a postback when the view is build but before the state of the<br>
&gt; component is restored.<br>
&gt;<br>
&gt; - With Partial State Saving disabled<br>
&gt;<br>
&gt;    * When the view is build at first time.<br>
&gt;    * In a postback when the view is &quot;refreshed&quot;, because all component nodes<br>
&gt; are detached and attached to the tree. In other words, on render response<br>
&gt; phase, vdl.buildView is called and in this case facelets algorithm add all<br>
&gt; transient components (usually all html markup not saved), and to do that, it<br>
&gt; detach and attach all components to be in right order. This also has some<br>
&gt; other implications, like c:if tag depends on this to work correctly.<br>
&gt;<br>
</div>This sounds ugly. You are sure that this is the behaviour in both<br>
MyFaces and Mojarra. Here my 2cents:<br>
<br></blockquote><div><br>I&#39;m 100% sure this is the current behavior. If the issue with c:if and partial<br>state saving was solved on mojarra, PSS = true should trigger <br>PostAddToViewEvent like PSS = false<br> </div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
- Partial state saving should not make any difference at all (also in<br>
partial state saving, the template should be reapplied before<br>
rendering, see my other mail)<br>
- PostAddToViewEvent should be called always after a component has<br>
been added to the view fully, and all its state has been restored<br>
<br></blockquote><div><br>I totally agree. Really it is necessary to add an event for relocate components<br>on the tree when the view is build. In myfaces, when we started to integrate<br>facelets it was detected, so right now there exists a class called<br>
PostBuildComponentTreeOnRestoreViewEvent. The problem to use this one<br>is it is inside myfaces impl jar, so if anyone wants to create a component<br>that requires relocation it will not be compatible with myfaces, so right now<br>
we are using the &quot;standard&quot; PostAddToView for this case.<br><br>I&#39;ll be more detailed about the conclusion I proposed on the first email. <br>What I want to be added on the spec is this:<br><br>- Create a new event (let&#39;s call it PostBuildViewEvent for the moment), that is <br>
propagated every time the view is build (when it is created, restored or<br>refreshed before render response). h:outputScript, h:outputStylesheet, <br>cc:insertChildren and cc:insertFacet should add a listener for this <br>
event and handle all relocation code at response of this event.<br><br>- Fix PostAddToViewEvent/PreRemoveFromViewEvent publishing conditions. <br>In my opinion this ones should not be called when the view is &quot;refreshed&quot;. <br>
Martin suggestion about the publishing conditions are reasonable.<br><br>I have to remember this topic here:<br><br> [jsr-314-open] add component resources depending on the owner component state<br><br>If exists an event like PostBuildViewEvent, that event could solve this one too <br>
(we could have PostRefreshViewEvent extends PostBuildViewEvent). <br><br>with best regards,<br><br>Leonardo Uribe<br><br></div></div>