in order to get a better understanding of the question, I suggest you to take a look at the following code:
<ui:repeat value="#{Reports}" var="r">
<div>
<p:selectBooleanCheckbox value="#{myService.ConvertIdToTrueOrFalse(r.Id)}"/>
</div>
</ui:repeat>
In this piece of code I have a collection with the name Reports
and I am using r
as my range variable, in order to iterate through my collection.
I have also a service called myService
.
I use <p:selectBooleanCheckbox/>
from primefaces.
What I am trying to do, is to call in each iteration the ConvertIdToTrueOrFalse
method from myService
and pass the Id
as input parameter.
Unfortunately, for some reason r.Id
is not recognized and it takes somehow 0 value.
How can I make the code recognize that r.Id
is coming from the Reports
collection?
Is there a special character that I have to use in order to signalize that r.Id
comes from Reports
collection?
The funny part is that the following code returns me the Ids from the collection as expected:
<ui:repeat value="#{Reports}" var="r">
<div>#{r.Id}</div>
</ui:repeat>
If you have any ideas or suggestions, please let me know.