January 11, 2011 at 4:10 am #17851
Hello everybody. I am from Brazil. First, I’d like to thanks the team of PrettyFaces and Lincon.
I’m developing a project with JSF2, Primefaces, PrettyFaces and Hibernate.
In welcome page of site, Primefaces and my JS functions works together, and them works fine.
the call to the JS files (in faces/index.xhtml) is so:
But in other pages that are in (faces/pages/somePage.xhtml) only work primefaces or JS funtions.
For exemple. If I put the code:
JS functions work fine but Primefaces dont’t work…
If I put the code:
Primefaces work fine and JS functions don’t work…
I guess that my rules is wrong
<rewrite trailingSlash=”ignore” toCase=”lowercase” />
<rewrite match=”^((?!.*.w*).)*$” trailingSlash=”append” toCase=”lowercase” />
Can somebody help me?
Thank you.January 11, 2011 at 6:15 am #20610
here a few notes on your problem.
1. It seems like you want to manually add jQuery to your page. I don’t think this is a good idea as PrimeFaces already includes jQuery. If your are using a different version of jQuery than PrimeFaces this may get a problem.
3. You should restrict your rewrite rules to match only desired pages. If you add a rewrite rules without or with a very general pattern all request (even resources loaded by PrimeFaces/JSF) will be rewritten. This may not be what you want as it may break PrimeFaces.
I hope this helps
ChristianJanuary 11, 2011 at 4:19 pm #20611
Lincoln Baxter IIIKeymaster
I also recommend using the JSF2
h:outputStylesheettags instead of directly using the HTML, this will make sure that the correct URL is used no matter from which page or URL you use it.January 12, 2011 at 2:08 am #20612
Hi Lincoln and Christian. Thank you for reply.
I suspected it was conflict between my manually Jquery insertion and Primefaces JQuery insertion, but but it seems that this is not.
Strange thing is that in index.xhtml page, page that is outside folder /faces/pages, Primefaces and JQuery functions work together.
Should I find help in Primefaces Forum?
Thanks!January 23, 2011 at 11:30 pm #20613
Hey Lucas. You should do what Christian told you to. You cannot import jquery.js using primeFaces because it already does it for you.
You can just use the jQuery functions you want with no problems, unless if you want to use a different version of jQuery. And that would be a problem.
Also, when using jQuery plugins together with primeFaces, before calling the jQuery functions, you should do the following:
1- use jQuery.noConflict();
2- switch all the $ you have in your functions calls to “jQuery”
if you have the code $(‘#menu ul’).hide();
you should do:
the noConflict needs to be called only once!
This will avoid coflicts among the 2 libs functions.
BTW, I am Brazilian too! o/
You must be logged in to reply to this topic.