Tuesday, March 19, 2013

Change ADF Default Error Messages

How to change ADF default messages

These are some requirement on which we want to change the default adf error messages.

I am explaining the way here using that you can change the ADF default error messages.


Default Adf Messages:

 

There are different way of doing this :
  •  Using Property File
  •  Using ListResourceBundle

Using Property File

Steps need to follow for using the property file:
  •   Create a property file like Messages_en.properties 
  •  Add the below lines in faces-config.xml



 

      Property file is as follows

org.apache.myfaces.trinidad.UIXEditableValue.REQUIRED=You must enter value for this fields.

org.apache.myfaces.trinidad.UIXEditableValue.REQUIRED_detail=Value is required in order to submit form.

Using ListResourceBundle
  • Create the java class which extends from ListResourceBundle
  • Code for java class are as follows:

public class CustomMessageBundle extends ListResourceBundle

{

  @Override

  public Object[][] getContents()

  {

    return new Object[][] { { "org.apache.myfaces.trinidad.UIXEditableValue.REQUIRED", "You must enter value for this fields" },{ "org.apache.myfaces.trinidad.UIXEditableValue.REQUIRED_detail", "Value is required in order to submit form." } };

  }

}

3.       Add this file to resource bundle like


  


After Error Message look like:


Sample Application can be found on click here 

18 comments:

  1. I am facing a problem related to ADF Error Popups. On IE8 this popup (similar to what you've shown in this post) goes away automatically without us doing anything. This is not happening on Firefox/Safari/Chrome. I did research on IE8 forum but nothings worked so far.

    Can you share your views on it?

    Note : I notice that on IE8 when the error popup comes up, it stays there for a second or so and then the Text / View behind it (In your example - Name & Date of Birth Popup) gets refreshed automatically and the Error popup goes away. I've tried disabling all PPR and autoSubmit but no results.

    Would really appreciate your help on this.

    ReplyDelete
  2. Pretty good post. I just came across your site and wanted to say that I’ve really enjoyed reading your posts. In any case I’ll be subscribing to your feed and I hope you will keep a good work!Cheer!


    sap online training
    software online training
    sap sd online training
    hadoop online training
    sap-crm-online-training

    ReplyDelete
  3. This is one awesome blog article. Much thanks again.
    I really enjoy the blog.Much thanks again. Really Great.


    oracle online training
    sap fico online training
    dotnet online training
    qa-qtp-software-testing-training-tutorial

    ReplyDelete

  4. After reading this web site I am very satisfied simply because this site is providing comprehensive knowledge for you to audience.
    Thank you to the perform as well as discuss anything incredibly important in my opinion. We loose time waiting for your next article writing in addition to I beg one to get back to pay a visit to our website in



    selenium training in Bangalore

    selenium training in Marathahalli

    selenium training in Btm layout

    selenium training in Jaya nagar

    selenium training in Electronic city

    selenium training in Kalyan nagar

    ReplyDelete

Thanks for your valuable comment. You comment will go live soon.