RF4 Wizard page problem - replacing panel contents leads to FacesException...ClassCastException: StateHolderSaver cannot be cast to Object
ssamayoagt May 26, 2011 12:24 PMI'm writing a wizard page which dynamically changes the content of panel but not only the content is bad rendering but when post is issued I got the following exception:
GRAVE: javax.faces.FacesException: Unexpected error restoring state for component with id fpaso:t1:s1:j_idt50:filter. Cause: java.lang.ClassCastException: javax.faces.component.StateHolderSaver cannot be cast to [Ljava.lang.Object;.
This is the partial part of the wizard where panel content is replaced:
<td width="80%" valign="top"><rich:panel id="paso" | ||||||||
style="height:#{ppAsistenteNormal.pasoInicial ? 500 : 450}px;"> | ||||||||
<f:facet name="header">#{ppAsistenteNormal.pasoActual.nombre}</f:facet> | ||||||||
<table width="100%"> | ||||||||
<tr> | ||||||||
<td><ui:include | ||||||||
src="/pp/pago/normal/paso#{ppAsistenteNormal.pasoActual.pasoId}.xhtml" /></td> | ||||||||
</tr> | ||||||||
</table> | ||||||||
</rich:panel></td> |
Problem came when panel is replaced and contains a rich:dataTable or rich:extendedDataTable: those components aren't rendered correctly.
When form is posted I get the above exception.
Just guessing, it seems that since is ajax replacement not all java script nor css is retrieved. I just looked for LoadScriptStrategy in RF4 but is no longer available.
So, if I cant find a way to get ALL css and js preloaded (that may not solve the problem anyway) seems that I will have to go back to JSF 1.2 with RF3.3 or use another component library.
Regards.
UPDATE:
Exception go away when I remove a <a4j:ajax> from inputs and, at differentpage, own composite component.
I have no clue why those components works well if page is "full" rendered but fails when is ajax rendered.
FWIW my composite componet is:
<composite:interface>
<composite:attribute name="popup" />
<composite:attribute name="hint" />
<composite:attribute name="filtered" default="false" />
</composite:interface>
<composite:implementation>
<a4j:commandLink id="filter">
<rich:componentControl event="click" target="#{cc.attrs.popup}"
operation="show">
<a4j:param id="event" name="event" value="event" noEscape="true" />
<rich:hashParam>
<a4j:param id="top" noEscape="true" name="top"
value="jQuery(#{rich:element('filter')}.parentNode).offset().top + jQuery(#{rich:element('filter')}.parentNode).height()" />
<a4j:param id="left" noEscape="true" name="left"
value="jQuery(#{rich:element('filter')}.parentNode).offset().left" />
</rich:hashParam>
</rich:componentControl>
<h:graphicImage library="img" name="filter12.png"
rendered="#{!cc.attrs.filtered}"
style="vertical-align: middle;border:0" alt="#{cc.attrs.hint}"
title="#{cc.attrs.hint}" />
<h:graphicImage library="img" name="filtered12.png"
rendered="#{cc.attrs.filtered}"
style="vertical-align: middle;border:0" alt="#{cc.attrs.hint}"
title="#{cc.attrs.hint}" />
</a4j:commandLink>
</composite:implementation>
Bad rendering stills.