Hello,
We have come across an issue that occurs in the combination of
myfaces-extval and primefaces.
We use the following configuration:
myfaces-extcdi-bundle-jsf20 (1.0.6)
myfaces-extval-core (2.0.6)
myfaces-extval-bean-validation (2.0.6)
myfaces-extval-property-validation (2.0.6)
primefaces-3.5 (revision 8433)
The new primefaces uses a JSF System-Event-Listener to register a widget
builder in the context.
<system-event-listener>
<source-class>javax.faces.component.UIViewRoot</source-class>
<system-event-class>javax.faces.event.PreRenderViewEvent</system-event-class>
<system-event-listener-class>org.primefaces.webapp.PreRenderViewListener</system-event-listener-class>
</system-event-listener>
with the following content:
public class PreRenderViewListener implements SystemEventListener {
public boolean isListenerForSource(Object source) {
return true;
}
public void processEvent(SystemEvent event) throws
AbortProcessingException {
FacesContext.getCurrentInstance().getAttributes().put(Constants.WIDGET_BUILDER_ATTR,
new WidgetBuilder());
}
}
However, this system event listener seems to be called too late, as the
ExtValLazyRendererProxy tries to encode components first. This leads to an
exception at application start:
java.lang.NullPointerException
at
org.primefaces.component.dialog.DialogRenderer.encodeScript(DialogRenderer.java:51)
at
org.primefaces.component.dialog.DialogRenderer.encodeEnd(DialogRenderer.java:43)
at
org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeEnd(ExtValLazyRendererProxy.java:76)
at
org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeEnd(ExtValRendererWrapper.java:358)
at
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:535)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:626)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
at
org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1320)
at
org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263)
at
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
at
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
at
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85)
Primefaces rejected this an an error in their code. Is there a way that
within myfaces-extval-core, it can be made sure that system event
listeners are called before the lazy renderer starts its work?
Thank you very much for your help,
Best regards,
Heiko
If you are not the intended addressee, please inform us immediately that you
have received this e-mail in error, and delete it. We thank you for your
cooperation.