JSF REQUIREMENTS

1

If I make a Request for my bean and this bean will make a query in a list. A list of cpf for example.

Can I update the client of this request with every result of this loop made in the bean? I ask this because often this list can be extensive and the customer will have to wait.

Would anyone have an alternative?

Thank you for your response. I'll try to be more specific. I want to create a list in excel by uploading cpf (only cpfs) ... to a list that is formed by cpf {number, evalue, name, dtNasc} (evalue = false, name="", Date = null) list is updated on my front. Done this has a start button. when calling the method in the bean many times because this list of cpf is very large, I only get the result (visualization) at the end of the execution of this method. I would like that during this loop when each cpf was queried and returned if it is valid, name and date of birth, return this partial result in the client and continue the execution of the rest of the loop let's say so .. Thank you in advance

    
asked by anonymous 14.08.2017 / 07:57

1 answer

1

You can upgrade the bean through Ajax . Using Primefaces you can use a paging component, such as Datatable and so this control would be done by the framework in the view. Already in the query, it would be necessary to implement a paging mechanism to limit the number of results brought. If you use JPA , you can follow this example", using the setFirstResult and setMaxResults methods to control the results brought by the Datatable page.

    
14.08.2017 / 14:54