Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

h:messages for components only.  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

How can I display messages releated to all components on a page (not global messages) with just one JSF tag? Is it possible?

I want to place such tag on the page top, but I don't need global messages.

Thanks in advance.
Oleg.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

In UI:

<h:messages layout="table"/>

Dont specify "for" attribute here. It will show all the messages.
 
Oleg Varaksin
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

Best regards.
Oleg.
 
Sridhar Ponnusam
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok. Did you try using "globalOnly" attribute of h:messages tag. true/false.



 
Oleg Varaksin
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I tried it. It didn't help.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!