Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-1577

Composite components displayed at bottom of page after clicking commandLink

    XMLWordPrintable

    Details

      Description

      When using Web Flow (2.3.1.RELEASE) in combination with JSF, 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:

      <!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>
      

      testComponent looks like this:

      <!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>
      

      My suspicion is that the ordering of components is messed up when Web Flow restores the view after resuming the flow. When using the above code in a simple JSF facelet (without using Web Flow), all is working fine.

      I've debugged through the internals of Mojarra and Web Flow and can see that the order is being mixed in the buildView(FacesContext ctx, UIViewRoot view) method of FaceletViewHandlingStrategy when using Web Flow and not when using plain JSF.

      See the attachments for the output of the example code. Before: ok.png, after clicking link: nok.png.

      Thanks in advance for having a look!

        Attachments

        1. nok.png
          nok.png
          0.7 kB
        2. ok.png
          ok.png
          0.7 kB

          Activity

            People

            Assignee:
            pwebb Phil Webb
            Reporter:
            slambert Stijn Lambert
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: