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

ActionListeners and JavaScript any Relation?

 
Ranch Hand
Posts: 124
C++ Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
being fairly new to the JSF framework , I wanted to know if there was any relation between ActionListeners and javascript ?? Since Javascript can also accomplish the same things as actionlisteners such as Checking for missing text in a textbox etc. Infact I think Javascript would be better than using actionlisteners since all the processing would be done at the client end instead of sending a call to the server.. Any comments would be appreciated...
 
Saloon Keeper
Posts: 28123
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Short answer: No.

Longer answer: Raw JavaScript doesn't understand the subtleties of JSF and the fact that it is client-side only is a liability when backing beans need to be consulted, because then you have to set up an AJAX request to query the server.

I normally have server-side validators because while they do carry penalties, I consider the penalties of allowing a client to bypass validation (possibly with malicious intent) to outweigh the benefits. That being said, there's absolutely no technical reason why someone couldn't create an extension tagset that validated in BOTH places - on the client side for performance and on the server side for security. I've been hoping someone would do that for years now, but haven't seen anything yet.
 
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic