Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-573

f:viewAction is executed twice with LAZY window handling mode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.6
    • 0.7
    • JSF-Module
    • None
    • tomcat 7.0.50
      java 7
      myfaces-2.2.2, deltaspike-0.6 (and deltaspike-0.7-SNAPSHOT )

    Description

      If you define h:head within your site and use ds:windowId (ClientWindowRenderMode.LAZY), then f:viewAction is called twice (2 window ids are generated)

      {code mypage.xhtml}

      <?xml version="1.0" encoding="UTF-8" ?>
      <!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:f="http://xmlns.jcp.org/jsf/core"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns="http://xmlns.jcp.org/jsf/passthrough"
      xmlns:jsf="http://xmlns.jcp.org/jsf"
      xmlns:ds="http://deltaspike.apache.org/jsf">

      <ui:remove>without h:head everything works correct</ui:remove>
      <h:head></h:head>

      <f:metadata>
      <f:viewParam id="myid" name="myid" value="#

      {viewParamBean.myId}"/>
      <f:viewAction action="#{initCtr.initApplication()}"/>
      </f:metadata>

      <h:body>
      <ds:windowId/>
      <h:form>
      #{viewParamBean.myId}

      </h:form>
      </h:body>
      </html>

      
      

      A testcase is attached.
      Start application and open http://localhost:8080/jsftest22/mypage.jsf
      You can see in the logs, that the viewAction is called two times.
      If you remove h:head from site, viewAction is called only once, which is the correct behaviour.
      If you don't use ds:windowId and have h:head defined, then viewAction is also called only once, which is the correct behaviour.

      I don't know if this is a deltaspike bug or a bug within myfaces.

      Attachments

        1. jsftest22_lazywindow.zip
          12 kB
          Rene O
        2. DELTASPIKE-573.patch
          2 kB
          Thomas Andraschko

        Issue Links

          Activity

            People

              tandraschko Thomas Andraschko
              reneo Rene O
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: