Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 Doctype使我的JSF崩溃_Jsf 2_Primefaces_Doctype - Fatal编程技术网

Jsf 2 Doctype使我的JSF崩溃

Jsf 2 Doctype使我的JSF崩溃,jsf-2,primefaces,doctype,Jsf 2,Primefaces,Doctype,我是JSF新手。我正在测试一个自适应表插件。在没有任何Doctype的情况下工作得很好,但是如果我放置了Doctype并且浏览器小于800px,则不会显示该表(@media应该调用该表的窄版本,但它不会)。我想在我的xhtml中设置Doctype。 使用Primefaces 3.5和Mojarra 2.1.14 代码如下: tabla.xhtml <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.co

我是JSF新手。我正在测试一个自适应表插件。在没有任何Doctype的情况下工作得很好,但是如果我放置了Doctype并且浏览器小于800px,则不会显示该表(@media应该调用该表的窄版本,但它不会)。我想在我的xhtml中设置Doctype。 使用Primefaces 3.5和Mojarra 2.1.14

代码如下:

tabla.xhtml

<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:p="http://primefaces.org/ui">
<h:head>  
    <meta name="viewport" content = "width = device-width" />
    <h:outputStylesheet library="css" name="stackStyle.css" />
    <h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
    <h:outputScript library="js" name="stacktable.js" />
    <h:outputScript library="js" name="estilito.js" />
    <h:outputStylesheet library="css" name="responsive.css" />  
</h:head>
<h:body> 
    <p:tabView id="tabView" style="width:80%; margin:2em auto">  
        <p:tab title="Part I">  
            <p:outputPanel styleClass="container ui-datatable-tablewrapper">
                <h:form prependId="false">
                    <p:dataTable styleClass="large-only" id="tablaResponsiva" cellspacing="0" var="car" value="#{tablesBean.cars}">
                        <p:column>
                            <f:facet name="header"  >
                                <h:outputText value="Usuarios" /> 
                            </f:facet>
                            <h:outputText value="#{car.model}"  />
                        </p:column>             
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Manufacturer" />
                            </f:facet>
                            <h:outputText value="#{car.manufacturer}"  />
                        </p:column>             
                        <p:column>
                            <f:facet name="header" >
                                <h:outputText value="Other Information" />
                            </f:facet>
                            <h:outputText value="#{car.otherInformation}" />
                        </p:column>
                    </p:dataTable>
                    <h:outputScript target="body">
                          $("#tabview\\:tablaResponsiva").stacktable({myClass:'stacktable small-only'});
                    </h:outputScript>
                </h:form>
            </p:outputPanel>
        </p:tab>   
    </p:tabView>       
</h:body>

$(“#tabview\\:tablaResponsiva”).stacktable({myClass:'stacktable small only'});

如有必要,还可以附加JS和CSS文件

事先非常感谢


*我测试了3个XHTML1.0文档类型(严格、过渡和框架集)。我还测试了XHTML1.1文档类型(basic和DTD)。我不喜欢任何doctype。我只想要一个,然后运行可调整大小的脚本。

您忘了告诉要设置的doctype。请使用当前的html doctype,即
测试HTML5 doctype。它也不起作用。没有更多的想法了吗?我还不能解决它。