Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrading jquery.js in primefaces.jar without modifying the JAR

I am working with Primefaces 3.1 and I found a bug in the jquery.js used (the bug is described and fix here: http://forum.jquery.com/topic/datepicker-doesn-t-work-inside-fixed-div). I am wondering if there is an elegant way for replacing the .js?

The replacement directly in the jar cannot be done because we are using Maven and I don't want to customise a library.

Currently, I replaced the HeadRenderer to remove the jquery.js from the header and I added my own js file, but there's maybe a Primefaces built-in option to do the same?

like image 688
893 Avatar asked Feb 18 '14 16:02

893


People also ask

How do I update JQuery in PrimeFaces?

Just put the desired jquery. js file in your own webapp project with the same resource identifier as PrimeFaces is using for its bundled jQuery: primefaces:jquery/jquery. js . Webapp's own resources with the same identifier have loading precedence over those in JARs.

Does PrimeFaces use JQuery?

JQuery extensionsPrimeFaces relies heavily on JQuery for interacting with the DOM. Many JQuery plugins are included that are used by the various widgets.


1 Answers

Just put the desired jquery.js file in your own webapp project with the same resource identifier as PrimeFaces is using for its bundled jQuery: primefaces:jquery/jquery.js. Webapp's own resources with the same identifier have loading precedence over those in JARs.

Thus, here:

WebContent
 |-- META-INF
 |-- WEB-INF
 |-- resources
 |    |-- primefaces
 |    |    `-- jquery
 |    |         `-- jquery.js
 :    :

Alternatively, just upgrade PrimeFaces itself. 3.1 is quite ancient anyway.

like image 147
BalusC Avatar answered Oct 12 '22 15:10

BalusC