JSF REQUESTS

Asked

Viewed 66 times

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 to each 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 any alternative?


Thank you for your answer. I will try to be more specific. I import a list in excel by uploading Cpf(only cpfs)... to a list that consists of Cpf{number,eValido,name,dtNasc} (eValido=false,name="",Data=null) so this list is updated on my front. Done this has a start button. by 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 consulted and returned if it is valid, name and date of birth, return this partial result to the client and continue the execution of the rest of the loop let’s say so.. Thanks in advance

1 answer

1

You can update the bean through the Ajax. Using Primefaces you can use a component that performs paging, 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 pagination mechanism to limit the number of results brought. In case of using JPA, you can follow this example, using the methods setFirstResult and setMaxResults to control the results brought by Datatable page.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.