Why my Bean is not recognizing the attribute of a simple selectOneMenu:
I created in my Bean the private Long areaprevencaoId
attribute.
This attribute is associated with a <p:selectOneMenu>
xhtml
<h:selectOneMenu value="#{cadastroUsuarioBean.areaPrevencaoId}">
<f:selectItems value="#{cadastroUsuarioBean.listaAreaPrevencaoSelect}"></f:selectItems>
</h:selectOneMenu>
<p:commandButton action="#{cadastroUsuarioBean.incluirArea}" value="Incluir"
process="@this" update="panel-grid-equipe" immediate="true" />
My Bean that uses the attribute:
public void incluirArea() {
if (areaPrevencaoId == null) {
messages.error("Selecione uma Equipe");
} else {
usuarioPrevencao.setUsuarioId(usuario.getId());
usuarioPrevencao.setAreaprevencaoId(areaPrevencaoId);
try {
usuarioPrevencaoRepository.salvar(usuarioPrevencao);
//this.listaUsuarioPrevencao = usuarioPrevencaoRepository.todosIdUsuario(usuario.getId());
} catch (PersistenceException e) {
messages.error("Erro ao gravar os dados da Equipe do Usuário");
}
}
RequestContext.getCurrentInstance().update(Arrays.asList("msg-area-prevencao","painel-equipe"));
}