Win a copy of Svelte and Sapper in Action this week in the JavaScript 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Refresh values of JSF page before validation occurs

Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
author and cow tipper
Posts: 5000
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic