Search This Blog

Tuesday, 9 April 2013

How to use FacesMessage component in ADF


How to use FacesMessage component in ADF

FacesMessage component is used to show confirmation, warning, information .In this tutorial, you will see that how to use FacesMessage component to show any information, warning or any error. Suppose you want to show a confirmation when you save your records, here we use FacesMessage.

Managed Bean Code to use FacesMessage(Information)-
      FacesMessage message = new FacesMessage("Record Saved Successfully!");   
      message.setSeverity(FacesMessage.SEVERITY_INFO);   
      FacesContext fc = FacesContext.getCurrentInstance();   
      fc.addMessage(null, message);   


To use for Error and Warning just change FacesMessage.SEVERITY_INFO toSEVERITY_ERROR or SEVERITY_WARN.
It will look like this 
You can change your Message accordingly

FacesMessage (Infromation)

No comments:

Post a Comment