I have the following scenario:
A DataTable where it has a button which executes a Bean method, however this DataTable is using a Paging with Lazy Loading, however according to the session annotation that I use the button method is not executed or the session is closed.
If you use the annotation Bean:
javax.enterprise.context.RequestScoped
All the search for popular DataTable is executed, however the edit button when triggered does not execute the Bean method.
The annotation is already used in the Bean:
javax.faces.view.ViewScoped
The search is not executed by a complete one, however, the edit button executes the Bean method.
I create the Session through a DAOFactory
public static DocumentoDAO criarDocumentoDAO() {
DocumentoDAOHibernate documentoDAO = new DocumentoDAOHibernate();
documentoDAO.setSession(HibernateUtil.getSessionFactory().getCurrentSession());
return documentoDAO;
}
Any suggestions on how to solve?