-
1. Re: How to avoid displaying duplicate messages
quaidbrown Jun 10, 2008 11:00 PM (in response to daclan)Those messages are added to the FacesMessages object. Here's a link to the api for that. You could try using the clear method before you add another message.
Also, just for your information...
Successful Created
isn't proper English. You should say something likeSuccessfully created (object name)
.Successfully created
orSuccessful create
would be technically ok, but aren't very user-friendly messages.Just trying to help :)
-
2. Re: How to avoid displaying duplicate messages
quaidbrown Jun 10, 2008 11:03 PM (in response to daclan)Oh, and just to be more clear, you probably have a line of code wherever your persistence is happening that looks like:
@In FacesMessages messages; ... public void persist(){ em.persist(myObject); messages.add("Successful created"); }
If you do messages.clear before you do messages.add, it would only appear once... but you can use that API listing to see how to manipulate it on your own.
-
3. Re: How to avoid displaying duplicate messages
daclan Jun 11, 2008 3:58 PM (in response to daclan)Thanks Matt !
The EntityHome.java and Home.java added the messages
Successfully created
automatically each time I call persist() on my entity.I found the way to change this message.