Primefaces + Bootstrap Admin LTE Conflict jQuery

Asked

Viewed 1,647 times

2

I have been working with Primefaces since version 2.1 and am currently creating a project in version 5 using Adminlte (http://almsaeedstudio.com/AdminLTE/) which is an administrative panel using the bootstrap base.

My problem is this: I created the template with ui:Color and started creating my pages. The problem is that pages containing Primefaces components, the Adminlte components, specifically jQuery, are not working. Side menu does not hide and no longer expands items.

I tried in various ways to resolve this conflict, but what I realized was that only the jQuery of the Adminlte stops working, the components of the first faces work smoothly. If anyone has any idea how to fix it I’m grateful.

2 answers

1

The primefaces also uses Jquery in its implementation, and automatically adds an import to jquery in the version it needs.

in the archive index.html Adminlte also has an import for Jquery

 <!-- jQuery 2.0.2 -->
 <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>

Importing jquery 2 times can cause problems in its working, remove any import to jquery.min.js or jquery.js, or any other file. js being imported 2x and leave only what you see by default with Primefaces.

  • Actually what I’m looking for now is a way to make Primefaces import jQuery to all pages. In my case the index page does not have components that depend on jQuery native to Primefaces and in these cases it does not matter. When I import jQuery it simply stops working for Bootstrap or Primefaces. As soon as I find the solution set for all.

1

I am working with the same template managed to solve the case as follows: 1 I put in the head the following code jQuery(Document). ready(Function(jQuery){ }); 2 removed jQuery/jquery-2.2.3.min. js from the template so I was able to avoid conflict

Browser other questions tagged

You are not signed in. Login or sign up in order to post.