Question

I have problem with JSF (1.2) + primefaces (1.1). I have written classic site on JSF, and I have for every article request scoped backing bean. The problem is, that when I try to rate the article, the backing bean no longer exists. So i want to force the JSF to output result of this expression during the render phase (so the ranking code will send the rendered Id), but if I use the dolar sign, everything works exacly as if I used the # (i thing that this might be bug in MyFaces).

Other solution wold be to session scope the backing bean, but user could have opened more pages (and he wold rate the last opened), other problem is what would happen, when the session expires....

Thanks for your help

    <p:rating stars="5" value="#{articleClientBean.userRating}" update="ratingCount, avgRating" rateListener="#{articleClientBean.handleRate}">
         <f:param value="#{articleClientBean.articleId}" name="articleId"/>
    </p:rating>
Was it helpful?

Solution

Use h:inputHidden instead.

<p:rating stars="5" value="#{articleClientBean.userRating}" update="ratingCount, avgRating" rateListener="#{articleClientBean.handleRate}" />
<h:inputHidden value="#{articleClientBean.articleId}" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top