Page 1 of 1

JQuery library is needed?

Posted: 08 Apr 2013, 22:27
by jab66
In my web project I have installed the PrimeFaces library. I'm not sure, but I want to know if it is necessary to also reference the libraries in the project jquery and jquery-ui. If these two do not include them in my project, the menuButton not work. Despite this, if included, the menuButton works in Firefox and Safari, but not in Internet Explorer 8. Am I doing something wrong?

Thanks.

Re: JQuery library is needed?

Posted: 08 Apr 2013, 22:29
by cagatay.civici
No, you just need to make sure you have h:head component in your page.

Re: JQuery library is needed?

Posted: 08 Apr 2013, 22:34
by jab66
optimus.prime wrote:No, you just need to make sure you have h:head component in your page.

This code is not working. Missing some additional configuration?

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui">
    
	<h:head>
	</h:head>
	
	<h:body>   

	<h:form id="frmHome">

		<p:menuButton value="Navigate">
			<p:menuitem value="Iniciar Sesion" url="#" />
			<p:menuitem value="Cargar mi CV" url="#" />
		</p:menuButton>

	</h:form>

	</h:body>  

</html>    

Re: JQuery library is needed?

Posted: 08 Apr 2013, 23:51
by cagatay.civici
Looks fine except you don't have a doctype.

Do you get any JS errors? What is the html output?

Re: JQuery library is needed?

Posted: 11 Apr 2013, 18:34
by jab66
optimus.prime wrote:Looks fine except you don't have a doctype.

Do you get any JS errors? What is the html output?

This is the html code.

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link type="text/css" rel="stylesheet" 
		href="/PrimeFaces/javax.faces.resource/theme.css.jsf?ln=primefaces-aristo" />
	<link type="text/css" rel="stylesheet" 
		href="/PrimeFaces/javax.faces.resource/primefaces.css.jsf?ln=primefaces" />
	<script type="text/javascript" 
		src="/PrimeFaces/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces">
	</script>
	<script type="text/javascript" 
		src="/PrimeFaces/javax.faces.resource/jquery/jquery-plugins.js.jsf?ln=primefaces">
	</script>
	<script type="text/javascript" 
		src="/PrimeFaces/javax.faces.resource/primefaces.js.jsf?ln=primefaces">
	</script>
</head>

<body>
	<form id="frmHome" name="frmHome" method="post" 
		action="/PrimeFaces/paginas/home/home.jsf;
		jsessionid=CAA627DF0F1BC7661D9A1C5DEE67FCAA" 
		enctype="application/x-www-form-urlencoded">
		<input type="hidden" name="frmHome" value="frmHome" />
		<span id="frmHome:j_idt4" class="ui-menubutton">
			<button id="frmHome:j_idt4_button" name="frmHome:j_idt4_button" 
				type="button" 
				class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-left">
				<span class="ui-button-icon-left ui-icon ui-c ui-icon-triangle-1-s"></span>
				<span class="ui-button-text ui-c">Navigate</span>
			</button>
				<div id="frmHome:j_idt4_menu" 
					class="ui-menu ui-menu-dynamic ui-widget ui-widget-content 
							ui-corner-all ui-helper-clearfix ui-shadow" 
					role="menu">
				<ul class="ui-menu-list ui-helper-reset">
					<li class="ui-menuitem ui-widget ui-corner-all" 
						role="menuitem">
					<a id="frmHome:j_idt5" 
						class="ui-menuitem-link ui-corner-all" href="#">
					<span class="ui-menuitem-text">Iniciar Sesion</span>
					</a>
					</li>
					<li class="ui-menuitem ui-widget ui-corner-all" 
						role="menuitem">
					<a id="frmHome:j_idt6" class="ui-menuitem-link ui-corner-all" href="#">
						<span class="ui-menuitem-text">Cargar mi CV</span>
					</a>
					</li>
				</ul>
				</div>
					</span>
						<script id="frmHome:j_idt4_s" type="text/javascript">
							$(function(){PrimeFaces.cw('MenuButton','widget_frmHome_j_idt4',{id:'frmHome:j_idt4'});});
						</script>
						<input type="hidden" name="javax.faces.ViewState" 
							id="javax.faces.ViewState" 
							value="6862480019439865476:-6817880496576995768" autocomplete="off" />
		</form></body>  
</html>
No error JS.

Thanks.

Re: JQuery library is needed?

Posted: 30 Apr 2013, 09:04
by JJLDJ
Are you getting any browser console errors? It sounds like it might be related to one of these issues:
http://code.google.com/p/primefaces/iss ... il?id=5470
viewtopic.php?f=3&t=29544
viewtopic.php?f=3&t=29633

Re: JQuery library is needed?

Posted: 30 Apr 2013, 09:35
by andyba
jab66 wrote:
optimus.prime wrote:Looks fine except you don't have a doctype.

Do you get any JS errors? What is the html output?

This is the html code.

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link type="text/css" rel="stylesheet" 
		href="/PrimeFaces/javax.faces.resource/theme.css.jsf?ln=primefaces-aristo" />
	<link type="text/css" rel="stylesheet" 
		href="/PrimeFaces/javax.faces.resource/primefaces.css.jsf?ln=primefaces" />
	<script type="text/javascript" 
		src="/PrimeFaces/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces">
	</script>
	<script type="text/javascript" 
		src="/PrimeFaces/javax.faces.resource/jquery/jquery-plugins.js.jsf?ln=primefaces">
	</script>
	<script type="text/javascript" 
		src="/PrimeFaces/javax.faces.resource/primefaces.js.jsf?ln=primefaces">
	</script>
</head>

<body>
	<form id="frmHome" name="frmHome" method="post" 
		action="/PrimeFaces/paginas/home/home.jsf;
		jsessionid=CAA627DF0F1BC7661D9A1C5DEE67FCAA" 
		enctype="application/x-www-form-urlencoded">
		<input type="hidden" name="frmHome" value="frmHome" />
		<span id="frmHome:j_idt4" class="ui-menubutton">
			<button id="frmHome:j_idt4_button" name="frmHome:j_idt4_button" 
				type="button" 
				class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-left">
				<span class="ui-button-icon-left ui-icon ui-c ui-icon-triangle-1-s"></span>
				<span class="ui-button-text ui-c">Navigate</span>
			</button>
				<div id="frmHome:j_idt4_menu" 
					class="ui-menu ui-menu-dynamic ui-widget ui-widget-content 
							ui-corner-all ui-helper-clearfix ui-shadow" 
					role="menu">
				<ul class="ui-menu-list ui-helper-reset">
					<li class="ui-menuitem ui-widget ui-corner-all" 
						role="menuitem">
					<a id="frmHome:j_idt5" 
						class="ui-menuitem-link ui-corner-all" href="#">
					<span class="ui-menuitem-text">Iniciar Sesion</span>
					</a>
					</li>
					<li class="ui-menuitem ui-widget ui-corner-all" 
						role="menuitem">
					<a id="frmHome:j_idt6" class="ui-menuitem-link ui-corner-all" href="#">
						<span class="ui-menuitem-text">Cargar mi CV</span>
					</a>
					</li>
				</ul>
				</div>
					</span>
						<script id="frmHome:j_idt4_s" type="text/javascript">
							$(function(){PrimeFaces.cw('MenuButton','widget_frmHome_j_idt4',{id:'frmHome:j_idt4'});});
						</script>
						<input type="hidden" name="javax.faces.ViewState" 
							id="javax.faces.ViewState" 
							value="6862480019439865476:-6817880496576995768" autocomplete="off" />
		</form></body>  
</html>
No error JS.

Thanks.
That is the output source code, we need the XHTML file (the real source code).