如何重写Primefaces jQuery和CSS [英] How to override Primefaces jQuery and css
问题描述
我正在使用PrimeFaces.由于PrimeFaces使用自己的jQuery,jqueryUI,jQuery-UI.css.我正在使用ui:composition.我所做的是在模板页面中这样添加一行
I am using PrimeFaces. As PrimeFaces uses its own jQuery, jqueryUI, jQuery-UI.css. I am using ui:composition. What i did i included a line in my template page like this
layout.xhtml
layout.xhtml
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
<ui:insert name="title">Login</ui:insert>
</title>
<ui:insert name="style"></ui:insert>
</h:head>
然后在我的页面上,我使用了类似的内容
Then on my page i used something like this
<h:body>
<ui:composition template="./WEB-INF/templates/layout.xhtml">
<ui:define name="title">Add News</ui:define>
<ui:define name="style"><h:outputStylesheet library="css" name="basit.css"/> </ui:define>
<ui:define name="content">
<h:form id="news_advertisement_form" >
...
</h:form>
</ui:define>
<ui:composition>
</h:body>
这是我页面上的basit.css,但问题是,css包括在Primefaces CSS和jQueries之前.我希望我的CSS出现在PrimeFaces CSS和jqueries之后.我该怎么做? 谢谢
This is including basit.css on my page but the problem is , css is including before primefaces css and jQueries. I want that my css appear after PrimeFaces Css and jqueries. How can i do it? Thanks
推荐答案
PrimeFaces记录了一个讨论此问题的问题.
There is an issue logged with PrimeFaces that discusses this problem.
http://code.google.com/p/primefaces/issues/detail?id = 2454
基本上,h:head
组件在包含来自h:head
内部的元素后,正在呈现PrimeFaces样式表和javascript.看起来也一样.
Essentially the h:head
component is rendering PrimeFaces stylesheets and javascripts after including elements from within the h:head
. There is also this issue which looks like it is the same.
http://code.google.com/p/primefaces/issues/detail?id = 2478
此问题在3.0中被标记为已修复,但是您可以尝试将样式表插入h:body
标记而不是h:head
内,这是一种可能的解决方法.
This issue is marked as fixed in 3.0, however you should try inserting your stylesheet inside the h:body
tag instead of h:head
as a possible workaround.
这篇关于如何重写Primefaces jQuery和CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!