Hi<br><br>On this link:<br><br><a href="https://issues.apache.org/jira/browse/MYFACES-2638">https://issues.apache.org/jira/browse/MYFACES-2638</a><br><br>attachment: MYFACES-2638-3.patch<br><br>I attached a proposal to fix this issue, based on myfaces code. The idea is <br>
create a event called javax.faces.event.PostBuildRefreshViewEvent. This event<br>is quite different from the one proposed in:<br><br>[jsr-314-open] add component resources depending on the owner component
state<br><br>because there is one case this one is not published: when partial state saving is <br>enabled and there is no call to vdl.buildView for refresh. I also notice that there is<br>no "inheritance" between events, that means, if I have two events and one extends<br>
from the other and there is a listener attached to the parent, when the child event<br>is raised the listener is not notified.<br><br>h:outputScript, h:outputStylesheet, cc:insertChildren, cc:insertFacet needs to attach<br>
its listeners to that event too, to give the chance to relocate their related components<br>correctly. The listener that track changes on the component tree and mark them to<br>be saved/restored fully does not need to listen this event.<br>
<br>PostAddToViewEvent/PreRemoveFromViewEvent should continue working as always,<br>the important here is disable event processing while we are refreshing the view. The side<br>effect is components added to the component tree when view is refreshed (c:if case) will<br>
not receive that event.<br><br>If we want to avoid that side effect, the proposal is change PostBuildRefreshViewEvent<br>to PostBuildViewEvent, this one will be an event specific for relocation and that one<br>should be published after the view is build, in other words, in the same place as<br>
we are doing PostBuildRefreshViewEvent but for all cases, but that one requires remove<br>the register of the listeners to PostAddToViewEvent on h:outputScript and related. Also,<br>it is necessary to indicate in some way when publish PostAddToViewEvent/<br>
PreRemoveFromViewEvent by facelets algorithm for build/refresh view, because it is there<br>where we have the knowledge about when propagate it or not.<br><br>I think at this point it is clear the problem and the possible direction to solve it, so I'll create<br>
an issue for this one on the spec issue tracker.<br><br>regards,<br><br>Leonardo Uribe<br><br><div class="gmail_quote">2010/3/30 Leonardo Uribe <span dir="ltr"><<a href="mailto:lu4242@gmail.com">lu4242@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Martin<br><br>In theory the secod event (PreRemoveFromViewEvent) should not be called <br>
<div class="im">when the view is "refreshed".<br><br></div>The important for me at this point is make clear the problem, but in this point<br>
I think the better is do a prototype with myfaces. It will take some time, but as<br>soon as I have something I'll publish the results, so we can discuss<br>a more concrete proposal. I'll integrate also the solution for the problem<div class="im">
<br>
"[jsr-314-open] add component resources depending on the owner component
state"<br></div>because it seems it is related.<br><br>regards,<br><br>Leonardo Uribe<br><br><div class="gmail_quote">2010/3/30 Martin Marinschek <span dir="ltr"><<a href="mailto:mmarinschek@apache.org" target="_blank">mmarinschek@apache.org</a>></span><div>
<div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<div><br>
> - Create a new event (let's call it PostBuildViewEvent for the moment), that<br>
> 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 "refreshed".<br>
> Martin suggestion about the publishing conditions are reasonable.<br>
<br>
</div>yes, this sounds good. Leonardo, for the second event, how would you<br>
suggest the publishing to happen (actual sourcecode)?<br>
<br>
best regards,<br>
<br>
Martin<br>
<font color="#888888">--<br>
</font><div><div></div><div><br>
<a href="http://www.irian.at" target="_blank">http://www.irian.at</a><br>
<br>
Your JSF powerhouse -<br>
JSF Consulting, Development and<br>
Courses in English and German<br>
<br>
Professional Support for Apache MyFaces<br>
</div></div></blockquote></div></div></div><br>
</blockquote></div><br>