How to override jQuery and css price lists

I am using PrimeFaces. As PrimeFaces uses its own jQuery, jqueryUI, jQuery-UI.css. I am using ui: composition. What I did was I included a line in my template page like this

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>

      

This is including basit.css in my page, but the problem is that css includes before css and jquery. I want my CSS to appear after PrimeFaces Css and jqueries. How should I do it? Thanks to

+3


source to share


2 answers


There is a PrimeFaces related issue that discusses this issue.

http://code.google.com/p/primefaces/issues/detail?id=2454

Essentially, the component h:head

renders the styles and javascripts of PrimeFaces after including elements from h:head

. There is also this problem that looks like it is the same.



http://code.google.com/p/primefaces/issues/detail?id=2478

This issue is marked fixed in version 3.0, however you can try to insert the stylesheet inside the tag h:body

instead h:head

as a possible workaround.

+2


source


<h:head>
    <!--This css will come just before Prime Faces skin.css -->
    <h:outputStylesheet library="css" name="messageDialogStyle.css" />
    <h:outputScript library="primefaces" name="jquery/jquery.js" />
    <h:outputScript >
        $ = jQuery;
    </h:outputScript>
    <h:outputScript library="Javascripts" name="default.js" />
    <h:outputScript library="Javascripts" name="jquery.dialog.js" />

    <!--These all come after PrimeFaces css -->
    <link rel="stylesheet" type="text/css" href="css/humera.css" />
    <link rel="stylesheet" href="css/witp.css" type="text/css" />

    <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>
<h:body>       
    <div>
        <ui:insert name="top1">
            <ui:insert name="style"></ui:insert>
            <ui:include src="header.xhtml" id="header"/>
            </ui:insert>
    </div>
    ....

</h:body>

      



+3


source







All Articles