In my previous question I had the problem of displaying validation messages from a Login form. That issue is now solved, but this time I am not able to display a custom message with FacesContex#addMessage.

I don't see a p:messages tag in your code. It is not the same as the p:message tag. p:message is attached to another component and is displayed as part of validation. The p:messages (or p:growl) component is what you are updating in your bean. Try adding a messages or growl component like this:

My bad. It was already working but the answer was a bit late and / or I hadn't seen it! So, the message is caught by the p:messages tag. But, how to catch the message with a non-global p:message tag without placing the componentId in the bean?
–
perissfMay 1 '12 at 13:32

1

I think you are asking how to catch the message and display on the dialog? Put a p:messages on the p:dialog. You can then add that to your update list on the command button. If there is a message sent back in the context it will update that one. You will probably need to turn off the autoUpdate="true" on your other messages component or both will be updated.
–
SteveSMay 1 '12 at 13:56