Hidden Message Box
Hi all. I would like to pop up an information message saying: "Your data has been saved." after the data has been saved in the data base. So, I try to do this:
if (cachedRowSetDataProvider1.canAppendRow()){
try{
RowKey indiceFila = cachedRowSetDataProvider1.appendRow();
cachedRowSetDataProvider1.setCursorRow(indiceFila);
cachedRowSetDataProvider1.setValue("Servicio.nombre",txtNombre.getValue());
cachedRowSetDataProvider1.setValue("Servicio.descripcion",txtDescripcion.getValue());
cachedRowSetDataProvider1.commitChanges();
getSessionBean1().setNuevoServicioRow(indiceFila);
[b]JOptionPane.showMessageDialog(null,"Sus datos han sido guardados correctamente","alert", JOptionPane.INFORMATION_MESSAGE);[/b]
return"guardar";
}
catch (Exception e){
error("No se puede agregar el registro: " + e);
returnnull;
}
}
But the dialog is hidden behind all the open windows. Any idea in how to solve this? Other possibility could be showing a message in the same jsp page (in a group message or something) saying the same text, "Your data has been saved". But if I throw a FacesMessage, it stops executing because it is treated as an exception.
Any help would be apreciated. Thanks.

