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);