Problem with Rating component

UI Components for JSF
Post Reply
hons
Posts: 3
Joined: 04 Feb 2012, 16:35

04 Feb 2012, 16:46

Hi,
I've a problem to get this component running.

Actually it runs but shows just 5 radiobuttons in a row instead of the 5 stars

In html it is then of course rendered as a series of <input>s
and not as a series of <div><a>--</a></div>

What could be the problem here...???

PrimeFaces 3.0.1
Tomcat 7
JSF 2.1.6
Last edited by hons on 04 Feb 2012, 20:19, edited 1 time in total.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

04 Feb 2012, 19:46

do you have h:head tag?
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

hons
Posts: 3
Joined: 04 Feb 2012, 16:35

04 Feb 2012, 20:33

That's basically my setup

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:pretty="http://ocpsoft.com/prettyfaces">

	<h:head>
	[..]
        </h:head>
	<h:body>
	[..]
        </h:body>
</html>
That's the template, that I'm filling with my JSF pages
Than the following is created

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link type="text/css" rel="stylesheet" href="/justbuyit/javax.faces.resource/theme.css.jsf?ln=primefaces-smoothness" />
	<link type="text/css" rel="stylesheet" href="/justbuyit/javax.faces.resource/primefaces.css.jsf?ln=primefaces&v=3.1-SNAPSHOT" />
	<link type="text/css" rel="stylesheet" href="/justbuyit/javax.faces.resource/rating/rating.css.jsf?ln=primefaces&v=3.1-SNAPSHOT" />
	<script type="text/javascript" src="/justbuyit/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=3.1-SNAPSHOT"></script>
	<script type="text/javascript" src="/justbuyit/javax.faces.resource/primefaces.js.jsf?ln=primefaces&v=3.1-SNAPSHOT"></script>
	<script type="text/javascript" src="/justbuyit/javax.faces.resource/rating/rating.js.jsf?ln=primefaces&v=3.1-SNAPSHOT"></script>
		
	<title>Title</title>
</head>
	<body>
		<div id="productRating">
			<input type="hidden" name="j_idt33" value="j_idt33" />
			<span id="j_idt33:messages"></span>
			<script id="j_idt33:messages_s" type="text/javascript">$(function(){PrimeFaces.cw('Growl','widget_j_idt33_messages',{id:'j_idt33:messages',msgs:[]});});</script>
			<span id="j_idt33:j_idt34">
			<input name="j_idt33:j_idt34_input" type="radio" value="1" />
			<input name="j_idt33:j_idt34_input" type="radio" value="2" />
			<input name="j_idt33:j_idt34_input" type="radio" value="3" />
			<input name="j_idt33:j_idt34_input" type="radio" value="4" checked="checked" />
			<input name="j_idt33:j_idt34_input" type="radio" value="5" />
			</span>
			<script id="j_idt33:j_idt34_s" type="text/javascript">$(function() {PrimeFaces.cw('Rating','widget_j_idt33_j_idt34',{id:'j_idt33:j_idt34',behaviors:{rate:function(event) {PrimeFaces.ab({source:'j_idt33:j_idt34',process:'j_idt33:j_idt34',update:'j_idt33:messages',event:'rate'}, arguments[1]);}}},'rating');});</script>
			<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="583952924873727405:-4800618003172545757" autocomplete="off" />
		</div>
	</body>
</html>
Which is a bit strange because in the showcase the p:rating tag does not create input tags.
Don't be confused I'm just trying right now with the Labs Snapshot, usually I'm on 3.0.1

hons
Posts: 3
Joined: 04 Feb 2012, 16:35

04 Feb 2012, 21:11

I've removed step by step every thing I could imagine and the "bad" one was a jquery include

Code: Select all

<script type="text/javascript" language="javascript" src="#{facesContext.externalContext.requestContextPath}/resources/js/jquery-1.7.1.js" />
And having the solution I found immediately the solution http://stackoverflow.com/questions/5457 ... primefaces

Thank u all for looking at my problem

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 47 guests