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

validation: two forms on same page  RSS feed

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I�ve got a problem with validation when I have two forms on the same page. In each form I display my error message by using h:messages. The problem is when I get an error on one form I end up displaying the message on both forms. I thought about using h:message and the �for� attribute, but this does not work. Reason being I�ve got backend validation that is not field specific it is form specific. Is there a way to tie h:messages to the form it�s contained in?
 
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I don't believe you can do this with the h:messages. h:messages pulls all messages out of the current FacesContext instance, which will display any messages in there whether from form validation or otherwise.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw your problem and thought you could help me with my problem. Some of my jsf forms have other jsf forms included. I am trying to validate fields on both forms but validation only effects the fields on the main form and not on the included form. Could you please give me any advise?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!