Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ActionListeners and JavaScript any Relation?  RSS feed

 
Adam Zedan
Ranch Hand
Posts: 124
C++ Fedora Java
  • Mark post as helpful
  • send pies
  • 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...
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!