show af:message programatically in ADF | Techartifact

Requirment- To show the message in ADF

ADF Faces uses the standard JSF messaging API. JSF supports a built-in framework for messaging by allowing FacesMessage instances to be added to the FacesContext object using the addMessage(java.lang.String clientId, FacesMessage message) method. You can set the type of message like – error, fatal,info,warning.

            FacesContext facesContext = FacesContext.getCurrentInstance();
            facesContext.addMessage("NoRecordsFound", 
                                    new FacesMessage(FacesMessage.SEVERITY_INFO,
                                                     "No Records Found", 
                                                     "No Orders matching searched criteria"));
            facesContext.renderResponse(); 

Happy coding with Techartifact

Vinay

I am an Oracle ACE in Oracle ADF/Webcenter. Sr Java Consultant-working on Java/J2EE/Oracle ADF/Webcenter Portal/ content and Hibernate for several years. I'm an active member of the OTN JDeveloper/Webcenter forum. Passionate about learning new technologies. I am here to share my knowledge. Give your views and suggestion on [email protected] .

More Posts - Website

Follow Me:
TwitterLinkedInGoogle PlusYouTube