You’ll need to put in some Managed bean annotated with PageScoped
or SessionScoped
, a variable of type int
(let’s call it indice
) which account from which object should start the verification.
The method that checks (which is also in this Managed bean) access the list of objects, get the three relevant objects and make a indice += 3;
. It is also important to put up at least one if
somewhere of this method to make sure you are not trying to access the list beyond the limits, which is important in case the list has already finished or has less than three objects remaining.
When all objects have been checked, you can make a indice = 0;
for him to resume the process. Or else perform some other action that you deem pertinent.
Stay tuned in case any element is inserted or deleted from the list (assuming there is such a case), otherwise this could mess with your checking.
Let me see if I got it right by putting my Managed bean as Pagescope or Sessionscope, the variable I created, Indice, will not lose its value every time my Poll makes a new call in the method, that’s it?
– Jason
@Jason Yes, with the
PageScoped
orSessionScoped
the bean, including all values stored in it, will survive from one request to another.– Victor Stafusa
Thank you, I think it will work, I will implement.
– Jason
@Jason If it works, don’t forget to mark my answer as accepted (the green "v" on the left below the answer score). If it doesn’t work, tell me what happened and we’ll see how to solve.
– Victor Stafusa
OK I’ll do it...
– Jason