UIRepeat issues
by Michal Petrov
First of all we seem to be tracking two kinds of issues:
1. Components not keeping their state when the page is refreshed* although caused by the same thing I'd expect this is working as intended, and a panel losing its collapsed/expanded state doesn't look like a serious issue
2. State change events where the event doesn't retrieve the old value properly* this is certainly an issue
With rich:collapsiblePanel there is PanelToggleEvent - what I've found out is that the event is fired during Apply Request Values Phase (phase 2). But in case of pure JSF, e.g. h:selectOneListBox (which I used in the reproducer for #3452), the ValueChangeEvent is fired during Process Validations Phase (phase 3).
My setup is this:
{code:jivemacro_uid=_14165667147859736|class=jive_text_macro jive_macro_code _jivemacro_uid_14165667147859736}
<h:panelGroup id="message" layout="block">
<h:outputText value="#{bean.message}" />
</h:panelGroup>
<h:panelGroup id="repeat">
<ui:repeat value="#{bean.list}" var="obj">
<rich:collapsiblePanel header="collapsible" toggleListener="#{bean.toggleListener}">
<h:outputText value="Content" />
<a4j:ajax event="switch" render="message" />
</rich:collapsiblePanel>
</ui:repeat>
</h:panelGroup>
{code}
{code:jivemacro_uid=_14165667211008357|class=jive_text_macro jive_macro_code _jivemacro_uid_14165667211008357}
public void toggleListener(PanelToggleEvent pte) {
setMessage("panel " + (pte.getExpanded() ? "expanded" : "collapsed"));
}
{code}
"panel expanded" is never displayed because of the issue
When I queue the event during phase 3 (AbstractTogglePanel.processValiators) and set a @render of the collapsiblePanel to rerender the ui:repeat it works correctly.
{code:modifiedtitle=true|jivemacro_uid=_14165668382394427|class=jive_text_macro jive_macro_code _jivemacro_uid_14165668382394427}<rich:collapsiblePanel … render="repeat, message"> {code}
Unfortunately this prevents on* events from firing, I'm trying to find a way around it.
Does anyone know why and if we need to fire the events during phase 2?
Posted by forums
Original post: https://developer.jboss.org/message/910997#910997
9 years, 11 months