Chapter 11. Miscellaneous Advanced Use Cases

In this chapter, we will cover the following topics:

  • Programmatic updating and scrolling with RequestContext
  • Two ways of triggering the JavaScript execution
  • Adding AJAX callback parameters – validation within a dialog
  • Opening external pages in dynamically generated dialogs
  • Polling – sending periodical AJAX requests
  • Blocking page pieces during long-running AJAX calls
  • Controlling form submission using defaultCommand
  • Clever focus management in forms
  • Layout pitfalls of menus and dialogs
  • Targetable messages with severity levels
  • Conditional coloring in dataTable
  • Sticking a component when scrolling
  • Reducing page load time using content caching
  • Possibilities for exception handling in PrimeFaces

Introduction

PrimeFaces has an impressive number of components that are usually suitable for both common and advanced use cases. It is almost impossible to cover all scenarios in just one book and discuss all solutions for each case. The key aspect of this chapter consists in giving users tips that can be applied quickly for often-raised questions. In this chapter, we will go beyond the basics and introduce more interesting features of the PrimeFaces library. We will learn about RequestContext, a helpful utility that allows you to mark components as updatable targets at runtime, add AJAX callback parameters; open external pages in dynamically generated dialogs—Dialog Framework—and much more. We will also develop a couple of real-world samples for common tasks such as blocking UI during AJAX calls, controlling form submission, periodic polling, focus handling, menus within the layout units and nested panels, targetable messages, sticky components, cached content, and exception handling.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.39.144