wood burning stoves 2.0*
The moose likes JSF and the fly likes Refresh values of JSF page before validation occurs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Refresh values of JSF page before validation occurs" Watch "Refresh values of JSF page before validation occurs" New topic
Author

Refresh values of JSF page before validation occurs

Meghna Bhardwaj
Ranch Hand

Joined: Jun 08, 2007
Posts: 109
Dear Rancher,

I am using JSF validation to simply check that the length of a field is 15, if not an error message is shown. My issue with this approach is
that user enters a number which is the correct length and clicks a button and some information is displayed about it. The second time when the user enters a number whose length is <15 then the validation error is shown BUT the information about the previous number remains on the screen.
My trouble is I am not sure how to do a refresh of the page.
I am doing validation like this:

Any ideas much appreciated.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Bind the inputText to an instance of HtmlInputText in a page bean.

Implement a ValueChangeListener (VCE). In the VCE, check the length. If the length is too long, you can change the value before rendering.

Of course, this might mess up your validation length tag, .

-Cameron McKenzie
 
Don't get me started about those stupid light bulbs.
 
subject: Refresh values of JSF page before validation occurs
 
Similar Threads
How to display custom message for inputText field of integer type
problem with Error message and Bean
Error message from Action class
Date Validation
Issue in localising client side javasctip validation error messages of "LiveValidation" in Seam