• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InputText Field - ValueChangeListener attribute

 
naveen gupta
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • 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
 
Swetha Venkat
Greenhorn
Posts: 2
Java MyEclipse IDE Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic