• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

How to show a single error message for all fields

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have a JSF from containing around 10 controls(input, select etc.) .
Now I need to display an error message in case any of the mandatory control has validation error.
Message format would be like
"Please,Complete the fields marked with yellow!" The message I need to show in a div tag with Yelow background.

Currently, I am getting individual default error message in case validation fails and related field is bordered with Yellow.

My code is below.
[color=red][/color]

(JSF1.2,Rich Faces 3.3.0,Facelets )

And a Phase Listener from
http://balusc.blogspot.com/2007/12/set-focus-in-jsf.html
This Phase listener is to border the control with Yellow in case validation fail.

Now my Query
1) How can I show a single message for all fields as I marked above in case of validation failure?
2) Now, the control is becoming yellow borderd when user clicks the submit button and validation fails.
User can move from one control to other using tab. That time proper validation message is appearing.
but the border of the control is not changing to yellow.
What's the correcion can be made to meet that requirement too.


regards
Roy






 
Gautam Ry
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am stuck.
could you help me ?

regards
roy
 
Saloon Keeper
Posts: 26295
186
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm afraid I don't have an answer offhand, but speaking as a customer, let me tell you I hate those kinds of pages. They waste my time while I go "treasure hunting" for the offending items, which are typically hard to spot. And a simple "you did it wrong" message doesn't help much.

In fact, one of the initial attractions that JSF had for me was that I could put a message next to the offending input so it would be right where I needed to see it.
 
It's fun to be me, and still legal in 9 states! Wanna see my tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic