gpt4 book ai didi

jsf - PrimeFaces主题不适用于标准JSF控件

转载 作者:行者123 更新时间:2023-12-01 13:25:52 26 4
gpt4 key购买 nike

我在素面有一个奇怪的问题。在某个时候,主题停止了正确地应用于标准JSF控件(如commandButton等)。不幸的是,我无法追溯问题的原因

我的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>
</h:head>

<h:body>
<p:spinner /> <!-- this one is skinned properly -->
<p:outputPanel>
Bla <p:commandButton /> <-- this one is not -->
</p:outputPanel>
</h:body>

我的web.xml
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>MyWebApp</display-name>
<welcome-file-list>
<welcome-file>index.jsf</welcome-file>
</welcome-file-list>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>bootstrap</param-value>
</context-param>

<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
</web-app>

在生成的HTML的源代码中,我注意到按钮类的设置不正确:

从源代码上看,我不太了解为什么要添加两个指向样式表的链接。主题的样式表不应该涵盖所有内容吗?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type="text/css" rel="stylesheet" href="/MyWebApp/javax.faces.resource/theme.css.jsf?ln=primefaces-bootstrap" />
<link type="text/css" rel="stylesheet" href="/MyWebApp/javax.faces.resource/primefaces.css.jsf?ln=primefaces&amp;v=4.0" />
<script type="text/javascript" src="/MyWebApp/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&amp;v=4.0"></script><script type="text/javascript" src="/MyWebApp/javax.faces.resource/jquery/jquery-plugins.js.jsf?ln=primefaces&amp;v=4.0">
</script>
<script type="text/javascript" src="/MyWebApp/javax.faces.resource/primefaces.js.jsf?ln=primefaces&amp;v=4.0">
</script>
</head>
<body>
<span id="j_idt6" class="ui-spinner ui-widget ui-corner-all">
<input id="j_idt6_input" name="j_idt6_input" type="text" class="ui-spinner-input ui-inputfield ui-state-default ui-corner-all" autocomplete="off" />
<a class="ui-spinner-button ui-spinner-up ui-corner-tr ui-button ui-widget ui-state-default ui-button-text-only">
<span class="ui-button-text">
<span class="ui-icon ui-icon-triangle-1-n">
</span>
</span>
</a>
<a class="ui-spinner-button ui-spinner-down ui-corner-br ui-button ui-widget ui-state-default ui-button-text-only">
<span class="ui-button-text">
<span class="ui-icon ui-icon-triangle-1-s">
</span>
</span>
</a>
</span>
<script id="j_idt6_s" type="text/javascript">PrimeFaces.cw('Spinner','widget_j_idt6',{id:'j_idt6'});
</script> <!-- this one is skinned properly -->
<div id="j_idt7" class="ui-outputpanel ui-widget">
Bla
<button id="j_idt9" name="j_idt9" class="" onclick="PrimeFaces.ab({source:'j_idt9'});return false;" type="submit">
<span class="ui-button-text ui-c">ui-button</span>
</button>
<script id="j_idt9_s" type="text/javascript">PrimeFaces.cw('CommandButton','widget_j_idt9',{id:'j_idt9'});
</script> <!-- this one is not -->
</div>
</body>
</html>

那就是我在浏览器中看到的:

运行时JBOSS AS 7.1.1

最佳答案

问题自行消失:S

关于jsf - PrimeFaces主题不适用于标准JSF控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22235901/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com