Thomas Andraschko created DELTASPIKE-729:
--------------------------------------------

             Summary: f:viewAction is executed twice with LAZY window handling 
mode
                 Key: DELTASPIKE-729
                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-729
             Project: DeltaSpike
          Issue Type: Bug
          Components: JSF-Module
    Affects Versions: 0.6
         Environment: tomcat 7.0.50
java 7
myfaces-2.2.2, deltaspike-0.6 (and deltaspike-0.7-SNAPSHOT )
            Reporter: Thomas Andraschko
            Assignee: Thomas Andraschko
            Priority: Minor
             Fix For: 0.7


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:p="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>
{code}

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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to