h:panelGrid sometimes renders invalid html
------------------------------------------

                 Key: MYFACES-3204
                 URL: https://issues.apache.org/jira/browse/MYFACES-3204
             Project: MyFaces Core
          Issue Type: Bug
          Components: General
    Affects Versions: 2.0.7
         Environment: JBoss AS 6, Windows Server 2008 R2
            Reporter: Robert M. Gary


If you use the following xhtml tags...


<?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"; xml:lang="en" lang="en"
        xmlns:h="http://java.sun.com/jsf/html";>
<body>

<h:form>
        <h:panelGrid>
            <div id="presetRanges">
                <h:panelGrid columns="1" rendered="false">
                    <!--<h:outputText value="bar"/>-->
                </h:panelGrid>
            </div>
        </h:panelGrid>
    </h:form>
</body>

</html>

 
It renders as...

 
<?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"; xml:lang="en" lang="en">
    <body>
        <form id="j_id1140648439_43fce9ed" name="j_id1140648439_43fce9ed" 
method="post"
             action="/testJSF2Web/testPage2.jsf" 
enctype="application/x-www-form-urlencoded">
            <table>
                <tbody>
                    <tr>
                        <td>
                            <div id="presetRanges">
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
        <input type="hidden" name="j_id1140648439_43fce9ed_SUBMIT" value="1"/>
        <input type="hidden" name="javax.faces.ViewState" 
id="javax.faces.ViewState"
               
value="q6SajcUugOiXkLYISx+QCHdiiJQJaJ0Jp3CJQ1RG4fxGBST1c3AxMgaZV3YCFzI9Zw0w96iHAnAMsgzyz8pgbdtPf62LeHqDS/XPyF4aZcRgRL6/wBvcghc1G/wLNvr2cnNRNw=="/>
    </form>
    <div id="javax_faces_developmentstage_messages"></div>
</body>
</html>

 
Notice that the <div> tag's closing is placed in the incorrect location in the 
table, resulting in invalid HTML.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to