JQuery library is needed?

Components, Ajax Framework, Utilities and More.
Post Reply
jab66
Posts: 6
Joined: 18 Mar 2013, 13:09

08 Apr 2013, 22:27

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.

User avatar
optimus.prime
Prime
Posts: 17586
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

08 Apr 2013, 22:29

No, you just need to make sure you have h:head component in your page.

jab66
Posts: 6
Joined: 18 Mar 2013, 13:09

08 Apr 2013, 22:34

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>    

User avatar
optimus.prime
Prime
Posts: 17586
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

08 Apr 2013, 23:51

Looks fine except you don't have a doctype.

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

jab66
Posts: 6
Joined: 18 Mar 2013, 13:09

11 Apr 2013, 18:34

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.

JJLDJ
Posts: 4
Joined: 09 Mar 2012, 05:46

30 Apr 2013, 09:04

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
PrimeFaces 3.5 | GlassFish 3.1.2.2 | JSF 2.1
NetBeans 7.2.1 | JDK 1.6 | Java EE 6 | Apache Derby 10.8.1.2
Windows Vista, Firefox 20

User avatar
andyba
Expert Member
Posts: 2475
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

30 Apr 2013, 09:35

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).
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Baidu [Spider] and 9 guests