When <p:rating> is nested inside a form, you cannot update a referenced
component:
Example code:
Code: Select all
<h:form id="form" prependId="false">
<!-- p:rating works here -->
<!--h:outputText id="globalRating" value="#{entry.rating}" /-->
<ui:repeat value="#{entries}" var="entry">
<div id="entry">
<div id="test">
<p:rating id="rating" value="#{entry.rating}"
rateListener="#{ratingmanager.handleRating}"
update="globalRating"
stars="5" />
<!-- p:rating does NOT respect prependId -->
<!--h:outputText id="globalRating" value="#{entry.rating}" /-->
</div>
</div>
</ui:repeat>
</h:form>
star rating components, one for each entry?
I have tried c:forEach instead of ui:repeat, but that does not work, which is logical.
For background, see http://www.ilikespam.com/blog/c:foreach ... n-facelets
Switching order of <h:form> and <ui:repeat> does not work either.
Looking at the HTML source code, the <h:outputText> gets a wrong id.
Anybody an idea to solve this?
Thanks,
Jonas