• 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Set focus to an element conditionally  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Typically figure this out only after posting, not to worry, all sorted here. Thanks anyway!
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!