I am using Primefaces 3.3.1, JSF 2.0 and Liferay 6.0 in my app. I have my JS files included in the portal_normal.vm as follows
portal_normal.vm
<html class="#language("lang.dir")" dir="#language("lang.dir")" lang="$w3c_language_id">
<head>
<title>$the_title - $company_name</title>
<script src="$javascript_folder/jquery-1.7.2.min.js"></script>
<script src="$javascript_folder/javascript.js"></script>
<script src="$javascript_folder/jquery.tablesorter.min.js"></script>
<script src="$javascript_folder/jquery.tablesorter.pager.js"></script>
<script src="$javascript_folder/jquery.autocomplete.js"></script>
<script src="$javascript_folder/jquery.simplemodal.1.4.2.min.js"></script>
<script src="$javascript_folder/jquery.scrollTo.js"></script>
<script src="$javascript_folder/ui.datepicker.js"></script>
$theme.include($top_head_include)
</head>
<body></body>
</html>
sample.xhtml:
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
lang="en" xml:lang="en" style="padding-bottom: 8px;">
<h:head>
<script type="text/javascript" src="#{lookupBean.themePath}/js/jquery-1.7.2.min.js" />
<script type="text/javascript" src="#{lookupBean.themePath}/js/javascript.js" />
<script type="text/javascript" src="#{lookupBean.themePath}/js/jquery.tablesorter.min.js" />
<script type="text/javascript" src="#{lookupBean.themePath}/js/ui.datepicker.js" />
</h:head>
<h:body></h:body>
</div>
Prime faces requires h:head to be included in the view. When I add the h:head to my xhtml, none of the js files are getting imported. Could you please let me know how can I add the .js to h:head?