Skip to Main Content
Mastering JavaServer Faces 2.2
book

Mastering JavaServer Faces 2.2

by Anghel Leonard
June 2014
Intermediate to advanced content levelIntermediate to advanced
578 pages
12h 2m
English
Packt Publishing
Content preview from Mastering JavaServer Faces 2.2

Working with client behavior functionality

JSF 2 comes with the ability to define specific client-side behavior to a component in a reusable approach. The client-side behavior is actually a piece of JavaScript code that can be executed in a browser.

For example, when the user has access to buttons that perform irreversible changes; for example, deletion, copy, and move is a good practice to inform the user about consequences and ask for a confirmation before the action is performed.

For implementing a client behavior functionality, we perform the following steps:

  1. Extend the ClientBehaviorBase class.
  2. Override the getScript method.
  3. Annotate the created class with the @FacesBehavior (value="developer_id") annotation where developer_id is used to refer ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaServer Faces

JavaServer Faces

Hans Bergsten

Publisher Resources

ISBN: 9781782176466Supplemental Content