I'm trying to replace "Transaction failed" with a message that will tell the
user that they have violated a unique constraint.
The problem I'm having is that if I override the message in messages_en
it will be specific to unique constraints.
I tried overriding the FacesMessage in the EntityHome persist method but,
I'm gettting "The instance was not associated with this session" when I try
to show that message on the page where the persist was attempted.
Here's the override:
| @End
| @Override
| public String persist()
| {
|
| try {
| super.persist();
| titleXiProjectFolder.create(getInstance().getProjectName());
| } catch (Exception e) {
|
| FacesMessages.instance().add("Record already exists.'Project Name'
must be unique");
| return "failure";
| }
|
| return "success";
|
| }
|
Any ideas how to post this message on the calling page?
Thanks,
JR
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088451#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...