1

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.

Neil Stockton
  • 11,383
  • 3
  • 34
  • 29
Origamer7
  • 315
  • 3
  • 17
  • Have you tried ? Since this might be a problem with r.Id being interpeted as a String in the html, and in the Java code it thinks r is an Object that it can't find while really the Java code should get a value. – Orvil Nordström Feb 24 '16 at 21:30
  • Is the answer in here (using varStatus)? http://stackoverflow.com/questions/16545731/values-of-hinputtext-inside-uirepeat-are-not-processed – Kukeltje Feb 25 '16 at 08:47
  • @OrvilNordström: I tried this out but unfortunately it does not work – Origamer7 Jul 06 '16 at 08:55
  • @Kukeltje: I do not know what varStatus is – Origamer7 Jul 06 '16 at 08:56
  • sorry to be so blunt, but there are these things called 'search engine'. Several exist... and there is an example in the link I used (did you read it?) – Kukeltje Jul 06 '16 at 17:56

0 Answers0