still you can use h:messages tag.
For example, How can I show a confirmation message after successfully persist data in database/ or a business validation message.
Java side code:
FacesContext context = FacesContext.getcurrentInstance();
context.addMessage(null, MessageUtils.getMessage(context, "Deatils saved successfully"); // we are passing component id as null here.
Dont specify "for" attribute here. It will show all the messages.
Joined: Dec 10, 2009
But I don't want all messages. I want to dispaly only component related messages which were created with
And I want to do that with just one JSF tag. Well, I already know it doesn't work. I think, I must iterate over FacesConfig.getClientIdsWithMessages() and pass each Id into the h:message for-attribute.
Joined: Dec 16, 2009
ok. Did you try using "globalOnly" attribute of h:messages tag. true/false.