Hello,
When using Web Flow (2.3.1.RELEASE) in combination with JSF (Mojarra 2.1.7), I have a rendering problem when using a composite component of any kind and e.g. an <h:outputLabel /> component on 1 page after clicking a <h:commandLink />. The contents of the composite component are always displayed at the bottom of the page! When refreshing the page, rendering is fine again...
I can very easily reproduce this using this code:
My facelet:
testComponent looks like this:HTML Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:test="http://java.sun.com/jsf/composite/components"> <h:body> <h:form id="form"> <h:commandLink id="link" value="link" /><br/> <test:testComponent id="test" /> <h:outputLabel value="label" id="label" /> </h:form> </h:body> </html>
Looks like this before clicking the link: ok.pngHTML Code:<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:composite="http://java.sun.com/jsf/composite"> <composite:interface> </composite:interface> <composite:implementation> <h:outputText value="hello world" /> </composite:implementation> </ui:composition>
And like this after: nok.png
When testing with a regular JSF facelet (without using Web Flow), the order of components is maintained and all looks fine.
I ran through the internals of Mojarra and Web Flow using the debugger and think it's caused by Web Flow restoring the view after handling the clicking of the link. Using Web Flow, the order of components is modified in between calls to f.apply(ctx, view) and doPostBuildActions(ctx, view) in com.sun.faces.application.view.FaceletViewHandling Strategy.
Thanks in advance for having a look. This is actually stopping us from using the Web Flow/JSF combination in production.
Best regards,
Stijn Lambert


Reply With Quote
