简体   繁体   中英

JSF force render value expression

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>

Use h:inputHidden instead.

<p:rating stars="5" value="#{articleClientBean.userRating}" update="ratingCount, avgRating" rateListener="#{articleClientBean.handleRate}" />
<h:inputHidden value="#{articleClientBean.articleId}" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM