migrate rating component from 1.x to 2.2.1

UI Components for JSF
Post Reply
svkap
Posts: 24
Joined: 30 Sep 2009, 14:07

24 May 2011, 10:24

Hello.

I am trying to move to latest primefaces but I experience some problems. I am following the rating component example from the showcase but I get the following exception:

<p:ajax> Parent not an instance of ClientBehaviorHolder: org.primefaces.component.rating.Rating@3c330a

I also have a couple of dynamically generated rating components and I am wondering how to migrate it also. More or less this is the code:

Code: Select all

org.primefaces.component.rating.Rating rating = new org.primefaces.component.rating.Rating();
rating.setId(ratingId);
rating.setValue(0);

rating.setDisabled(false);
MethodExpression ratingActionExpression = expressionFactory
		.createMethodExpression(elContext,
				"#{bean.rateHandle}", null,
				new Class[] { RateEvent.class });
// rating.setRateListener(ratingActionExpression);

// AjaxBehavior ab = new AjaxBehavior();
// ab.setListener(ratingActionExpression);
// ab.setUpdate("panelId");

rating.setUpdate("panelGridFootballSkillsId");
rating.setRateListener(ratingActionExpression);

ValueExpression ratingValueExpression = expressionFactory
		.createValueExpression(elContext,
				"#{bean.ratings." + ratingId
						+ ".rating}", Double.class);
rating.setValueExpression("value", ratingValueExpression);
I am using Mojarra-2.1.1.
Last edited by svkap on 24 May 2011, 10:39, edited 1 time in total.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

24 May 2011, 10:32

You are coding against 3.0 snapshots, try showcase (not labs) or user's guide for reference.

svkap
Posts: 24
Joined: 30 Sep 2009, 14:07

24 May 2011, 10:47

Yes, this was the problem. I have to be more careful :). However, it looks like my bean handlers for rate event do not execute. There are no exceptions in the console, just that warning: org.apache.tomcat.util.http.Parameters processParameters
WARNING: Parameters: Invalid chunk '' ignored.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 48 guests