My Oracle Support Banner

ADF Best Practices: Using Javascript in ADF Faces (Doc ID 1343024.1)

Last updated on OCTOBER 21, 2022

Applies to:

Oracle JDeveloper - Version 11.1.1.0.0 and later
Information in this document applies to any platform.

Purpose


This document aims to describe some of the best practices for using Javascript code in an ADF application.

Questions and Answers

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Purpose
Questions and Answers
 --- Scope and Application ---
 --- ADF Best Practices: Using Javascript in ADF Faces ---
 1.  Understand the ADF Faces client architecture before using JavaScript.
 2. Do not use protected or private JavaScript functions and variables in ADF Faces shown by browser DOM introspection tools
 3. Before accessing a component from JavaScript, make sure it exists.
 4. In JavaScript functions, do not hard code component ids that appear in the generated HTML page output.
 5. Events that don't need to propagate to the server should be cancelled.
 6. Minimize Client to Server calls to prevent unnecessary network round trips
 7. In custom JavaScript code, only use public APIs and constants.
 8. Handle exceptions gracefully; do not just suppress them
 9. JavaScript should not be used to override component functionality or the framework behavior
 10. JavaScript Authorization is not enough. ADF Security should be used to secure your application.
 Conclusion

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.