I'm doing a registration that has a relationship with another, I'm using SelecOneMenu to draw it, when I make a new one it works correctly, but in editing it is not bringing the object of the other class, and when I just save a record and I try to edit it behind the object, but just refresh the page that does not come back, the other text fields, back normally.
public void updateInterface () {
try {
Sistema sistema = new Sistema();
SistemaDao sistemaDao = new SistemaDao();
sistema = sistemaDao.buscaPorId(idSistema);
InterfaceDao interfaceDao = new InterfaceDao();
interfaceSistema.setSistema(sistema);
interfaceDao.atualizar(interfaceSistema);
String msg = "Interface " + interfaceSistema.getDescricao() + " Alterada com sucesso";
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, message);
} catch (RuntimeException e) {
throw new RuntimeException("Erro ao atualizar a interface no Bean");
} finally {
listarInterface();
}
}
public void selectInterface (ActionEvent event) {
interfaceSistema = (Interface) evento.getComponent().getAttributes().get("interfaceSelecionado");