• 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

rich:ajaxValidator problem

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using JSF 1.2 on JBoss 5.1GA.
My problem is that if i use event="onblur", the second time in a row the component loses focus i receive this validator(or convertor?) message instead of mine:

j_id_jsp_747421929_4:sold_quantity: '8,8' must be a signed decimal number consisting of zero or more digits, that may be followed by a decimal point and fraction. Example: 198.23



This is my validation annotation:


this is in my .jsp file:


Using event="onkeyup" or event="onblur" doesn't remove the validator message when the input is fine, and if i insist eventually i get the other message above.

EDIT:

Playing some more with it, made this test, that has a similar problem:



While it displays the message, it only happends when the control loses the focus twice, same for message removal, it doesn't remove it the first time the valid control loses focus, but the second time.

EDIT2:
there are a couple of ways to avoid this:
First, create your own JSF regex validator and use a4j:support for AJAX behaviour.
Second, use a String instead of the data type that triggers the JSF validator/converter (like my BigDecimal), then do the parsing in the backing bean before using it.
reply
    Bookmark Topic Watch Topic
  • New Topic