• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

InputText Field - ValueChangeListener attribute

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to do validation using regular expressions in my JSF backing bean using ValueChangeListener attribute for inputtext component

When i enter a value "2342342343" it does validation and shows error message
But when i edit the entered value by removing OR adding couple of integers, valuechangelistener is not invoked and no validation takes place
When i completely remove the entered value and reenter new value then validation takes place

Is there a way to do validation when the entered value is edited instead of completely re-entering new value


thanks in advance
 
Greenhorn
Posts: 2
MyEclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Have you implemented valueChangeEvent and passing getNewValue() and getOldValue() correctly?
Alternately, Just see if you can use JSF validator Tag instead of using listeners
 
naveen gupta
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured it out.

First i tried JSF validator tag then thought it's not doing what i want then i tried ValueChangeListener. ( experimenting everything as i am new to JSF )

The whole problem was i have kept regular expressions in external properties file. And this property file was not read in the first case.

It's working fine now. thanks

SUGGESTION TO BEGINERS: keep as many LOG statements as you can
 
reply
    Bookmark Topic Watch Topic
  • New Topic