• 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

Set focus to an element conditionally

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am using JSF richfaces 3.3.0. I have a rich:datatable, one of the columns is a h:inputtext and I need to validate the input as it happens. I call a method onblur in my backing bean that checks the value and displays an error message if the value is out of range (this works). I would however like the h:inputtext element to gain focus only if the value is out of bounds. The focus attribute does not work as this only specifies which element should gain focus after the function is complete and therefore happens regardless of the value entered. I have tried to embed some Javascript in my xhtml file (see below) but this does not seem to be working. Any suggestions are welcome.

 
Jason O'Brien
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Typically figure this out only after posting, not to worry, all sorted here. Thanks anyway!
 
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic