I'm trying to make a postback in my project but I'm not getting it.
When I submit the form, it continues to do select without precision. That is, it stayed the same way
public class FacesUtil {
/**
* Método que avalia se é postBack.
* @return
*/
public boolean isPostback(){
return FacesContext.getCurrentInstance().isPostback();
}
/**
* Método que nega o PostBack
* @return
*/
public static boolean isNotPostBack(){
return !isNotPostBack();
}
}
MyBean
public void inicializar() {
System.out.println("Inicializando Cadastro de Carro...");
if(FacesUtil.isNotPostBack()){
modeloCarros = modeloCarroService.buscarTodos();
}
if (this.carro == null) {
limpar();
}
}