I have a list of items that I have to display with a textbox for each item which is bound to a rating object's points property. At first I used a primefaces p:dataList like this:
<p:dataList var="item" value="#{cc.attrs.task.itemsWithSolutions}">
<div>
<h:outputText value="#{item.item.description}" escape="false" />
<p:outputPanel rendered="#{item.item.maximumPoint > 0.0}">
<h:outputText value="#{item.item.maximumPoint}/" />
<p:inputText value="#{ratingController.getTrainerRating(item).points}"/>
</p:outputPanel>
</div>
<h:outputText value="#{item.solution.content}" />
</p:dataList>
And it worked fine. However, the designer asked me to use ui:repeat here insted because it's easier for him to work with. I thought this couldn't pose a problem but when I changed the p:datalist to ui:repeat i got a NullPointerException when calling ratingController.getTrainerRating(item). When I looked at it in the debugger I found the value of item (in which the controller looks up the corresponding rating object) was null. This problem didn't occur when using p:datalist or p:dataTable. Could you tell me why this happens?