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.

[1803 byte] By [linuc@] at [2007-11-26 9:07:07]
# 1
Hi There,One way I could think of is to navigate the user to a new page after theis jpg, in the new page you say your message.Another way could be using javascript popup window.Hope this helpsThanksK
kish@sun at 2007-7-6 23:21:35 > top of Java-index,Development Tools,Java Tools...
# 2
Here is another alternative http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/pag e_alerts.html
jetsons at 2007-7-6 23:21:35 > top of Java-index,Development Tools,Java Tools...
# 3

Use an Image Hyperlink component instead of a button. Add an action handler for the component, just like you did for the button. In addition, use Page Navigation to draw a link from the Image Hyperlink to the .jsp with the message.

In the Properties window for the Image Hyperlink, set the target property to New window.

Set the image for the component to an image of a button.

jetsons at 2007-7-6 23:21:35 > top of Java-index,Development Tools,Java Tools...