Show HTML formatting in Oracle ADF

Quick Tip- If you have html content stored in database in string and you want to display same html formatting in ADF.

Use escape attribute in outputText’s escape attribute.You can also try outputFormatted also.In outputFormatted there is no escape property.

     <af:outputText value="&lt;h2>&lt;b>Techartifact&lt;/b>&lt;/h2>" id="ot1"
                         escape="false"/>
          <af:outputFormatted value="&lt;h2>&lt;b>Techartifact&lt;/b>&lt;/h2>" id="of1"/>

and output wil be like below

blog

Happy learning with Vinay Kumar in techartifact.

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