Please disable your adblock and script blockers to view this page

Search this blog

Monday, 15 October 2012

ADF Basics: Show inline Message in Oracle ADF




When we use any technology sometimes we need to show an alert message or warning or confirmation.
In Oracle ADF we use Faces Message same as JSF.
In this tutorial I am showing you that how to implement inline FacesMessage .

Those who are familiar with Oracle ADF can create basic architecture of MVC.
So follow these steps

  • Create a Fusion Web Application in Jdeveloper(IDE)
  • Now in ViewController create new Page.
  • Simply drag a CommandButton from Component Palette to page
  • and Write this code on button




public void showMessageButton(ActionEvent actionEvent) {
 FacesMessage msg=new FacesMessage("This is an inline FacesMessage");
 msg.setSeverity(FacesMessage.SEVERITY_FATAL);
 FacesContext fctx=FacesContext.getCurrentInstance();
 fctx.addMessage(null, msg);
 }
  • It will work as FacesMessage
  • Now drag a af:messages component in page from Component Palette

    select af:message from component pallette

  • Select af:messages and go to property inspector and set Inline-true

    Set inline true for af:message

  • Now run your page and click on button , it will look like this

    Inline Error Message Oracle ADF

  • This is how we show inline alert in Oracle ADF

2 comments :

  1. Hi,

    I tried your approach and it worked fine at very first go. But what intrigues me is i want my Message to be displayed in front o critical error thing and not below CRITICAL Error. Guide me if you have any approach for this/

    ReplyDelete
  2. Here I learn how to show inline message in oracle adf,Thank you.
    Regards,
    Oracle ADF Training.

    ReplyDelete