0

我正在使用最新的 PrimeFaces (3.6-SNAPSHOT)。在火狐上测试。

我一直在尝试隔离问题。这是我发现的。

我的页面设计如下:一个TabView - 它的每个选项卡都包含另一个 TabView,它的每个选项卡都包含一个Layout

问题是在某些选项卡上,布局没有出现。当我使用 PrimeFaces 3.4.2 编译时,无论我是否单击另一个选项卡,然后单击返回缺少布局的选项卡,都不会显示丢失的布局。但是,当我使用 PrimeFaces 3.6-SNAPSHOT 编译时(单击另一个选项卡,然后单击缺少布局的选项卡) - 出现缺少的布局。疯了吧?

真正疯狂的是,当我看到布局不可见时,我用 firebug 检查它,发现它的 HTML 与它显示时的不同......

怎么可能??我以为我得到了一个静态页面(带有一些 Javascript,但 HTML 本身仍然没有变化)。这超出了我的理解。

例如,重新启动 Firefox,加载页面并尝试按以下顺序单击选项卡:(1,1) (1,2) (1,3) (1,4) 一切正常。现在单击选项卡 2(标题)。您是否看到选项卡 (2,1) 中的布局消失了?现在单击 (2,2) 并返回 (2,1) - 现在布局就在那里。奇怪的东西。

知道发生了什么吗?

它可能与这个问题有关: https ://stackoverflow.com/questions/13978438/primefaces-layout-not-working-inside-tabview

这是代码,您可能想尝试一下。

<?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:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

<h:head>

</h:head>
<h:body>

    <p:tabView id="tabView">  

        <p:tab id="tab1" title="Godfather Part I">  
            <h:panelGrid columns="2" cellpadding="10">  
                <p:graphicImage id="tab1Img" value="/images/godfather/godfather1.jpg" />  
                <h:outputText id="tab1Text"  
                    value="The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.  
                    His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. T  
                    hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect,  
                    but given to ruthless violence whenever anything stands against the good of the family." />  
            </h:panelGrid> 

            <p:tabView id="tabView1">  

                <p:tab id="tab1" title="Godfather Part I">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab1Img" value="/images/godfather/godfather1.jpg" />  
                        <h:outputText id="tab1Text"  
                            value="The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.  
                            His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. T  
                            hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect,  
                            but given to ruthless violence whenever anything stands against the good of the family." />  
                    </h:panelGrid>

                    Layout (1,1)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout1">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>  

                <p:tab id="tab2" title="Godfather Part II">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab2Img" value="/images/godfather/godfather2.jpg" />  
                        <h:outputText id="tab2Text" value="Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather, parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream.  
                        In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy,  
                        killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows."/>  
                    </h:panelGrid>

                    Layout (1,2)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout2">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>  

                <p:tab id="tab3" title="Godfather Part III">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab3Img" value="/images/godfather/godfather3.jpg" />  
                        <h:outputText id="tab3Text" value="After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family.  
                            Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate."/>  
                    </h:panelGrid>

                    Layout (1,3)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout3">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>

                <p:tab id="tab4" title="Godfather Part IV">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab3Img" value="/images/godfather/godfather3.jpg" />  
                        <h:outputText id="tab3Text" value="After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family.  
                            Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate."/>  
                    </h:panelGrid>

                    Layout (1,4)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout4">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>  

            </p:tabView>

        </p:tab>  

        <p:tab id="tab2" title="Godfather Part II">  
            <h:panelGrid columns="2" cellpadding="10">  
                <p:graphicImage id="tab2Img" value="/images/godfather/godfather2.jpg" />  
                <h:outputText id="tab2Text" value="Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather, parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream.  
                In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy,  
                killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows."/>  
            </h:panelGrid>

            <p:tabView id="tabView2">  

                <p:tab id="tab1" title="Godfather Part I">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab1Img" value="/images/godfather/godfather1.jpg" />  
                        <h:outputText id="tab1Text"  
                            value="The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.  
                            His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. T  
                            hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect,  
                            but given to ruthless violence whenever anything stands against the good of the family." />  
                    </h:panelGrid>

                    Layout (2,1)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout1">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>  

                <p:tab id="tab2" title="Godfather Part II">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab2Img" value="/images/godfather/godfather2.jpg" />  
                        <h:outputText id="tab2Text" value="Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather, parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream.  
                        In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy,  
                        killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows."/>  
                    </h:panelGrid>

                    Layout (2,2)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout2">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>  

                <p:tab id="tab3" title="Godfather Part III">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab3Img" value="/images/godfather/godfather3.jpg" />  
                        <h:outputText id="tab3Text" value="After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family.  
                            Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate."/>  
                    </h:panelGrid>

                    Layout (2,3)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout3">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>

                <p:tab id="tab4" title="Godfather Part IV">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab3Img" value="/images/godfather/godfather3.jpg" />  
                        <h:outputText id="tab3Text" value="After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family.  
                            Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate."/>  
                    </h:panelGrid>

                    Layout (2,4)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout4">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>  

            </p:tabView>

        </p:tab>  

        <p:tab id="tab3" title="Godfather Part III">  
            <h:panelGrid columns="2" cellpadding="10">  
                <p:graphicImage id="tab3Img" value="/images/godfather/godfather3.jpg" />  
                <h:outputText id="tab3Text" value="After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family.  
                    Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate."/>  
            </h:panelGrid>

            <p:tabView id="tabView3">  

                <p:tab id="tab1" title="Godfather Part I">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab1Img" value="/images/godfather/godfather1.jpg" />  
                        <h:outputText id="tab1Text"  
                            value="The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.  
                            His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. T  
                            hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect,  
                            but given to ruthless violence whenever anything stands against the good of the family." />  
                    </h:panelGrid>

                    Layout (3,1)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout1">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>  

                <p:tab id="tab2" title="Godfather Part II">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab2Img" value="/images/godfather/godfather2.jpg" />  
                        <h:outputText id="tab2Text" value="Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather, parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream.  
                        In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy,  
                        killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows."/>  
                    </h:panelGrid>

                    Layout (3,2)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout2">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>  

                <p:tab id="tab3" title="Godfather Part III">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab3Img" value="/images/godfather/godfather3.jpg" />  
                        <h:outputText id="tab3Text" value="After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family.  
                            Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate."/>  
                    </h:panelGrid>

                    Layout (3,3)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout3">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>

                <p:tab id="tab4" title="Godfather Part IV">  
                    <h:panelGrid columns="2" cellpadding="10">  
                        <p:graphicImage id="tab3Img" value="/images/godfather/godfather3.jpg" />  
                        <h:outputText id="tab3Text" value="After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family.  
                            Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate."/>  
                    </h:panelGrid>

                    Layout (3,4)

                    <p:layout style="min-width:400px;min-height:200px;" id="layout4">  
                        <p:layoutUnit position="west" resizable="true" size="100" minSize="40" maxSize="200">  
                            West  
                        </p:layoutUnit>  

                        <p:layoutUnit position="center">  
                            Center  
                        </p:layoutUnit>  
                    </p:layout>

                </p:tab>  

            </p:tabView>

        </p:tab>  

    </p:tabView>

</h:body>

</html>
4

0 回答 0