This chapter describes how you can create reusable content and then use that content
to build portions of your JSF pages or entire pages.
This chapter includes the following sections:
■ Section 19.1, "Introduction to Reusable Content"
■ Section 19.2, "Using Page Fragments"
■ Section 19.3, "Using Page Templates"
■ Section 19.4, "Using Declarative Components"
■ Section 19.5, "Adding Resources to Pages"
19.1 Introduction to Reusable Content
As you build JSF pages for your application, some pages may become complex and
long, making editing complicated and tedious. Some pages may always contain a
group of components arranged in a very specific layout, while other pages may always
use a specific group of components in multiple parts of the page. And at times, you
may want to share some parts of a page or entire pages with other developers.
Whatever the case is, when something changes in the UI, you have to replicate your
changes in many places and pages. Building and maintaining all those pages, and
making sure that some sets or all are consistent in structure and layout can become
increasingly inefficient.
Instead of using individual UI components to build pages, you can use page building
blocks to build parts of a page or entire pages. The building blocks contain the
frequently or commonly used UI components that create the reusable content for use
in one or more pages of an application. Depending on your application, you can use
just one type of building block, or all types in one or more pages. And you can share
some building blocks across applications. When you modify the building blocks, the
JSF pages that use the reusable content are automatically updated as well. Thus, by
creating and using reusable content in your application, you can build web user
interfaces that are always consistent in structure and layout, and an application that is
scalable and extensible.
ADF Faces provides the following types of reusable building blocks:
■ Page fragments: Page fragments allow you to create parts of a page. A JSF page
can be made up of one or more page fragments. For example, a large JSF page can
be broken up into several smaller page fragments for easier maintenance. For
to build portions of your JSF pages or entire pages.
This chapter includes the following sections:
■ Section 19.1, "Introduction to Reusable Content"
■ Section 19.2, "Using Page Fragments"
■ Section 19.3, "Using Page Templates"
■ Section 19.4, "Using Declarative Components"
■ Section 19.5, "Adding Resources to Pages"
19.1 Introduction to Reusable Content
As you build JSF pages for your application, some pages may become complex and
long, making editing complicated and tedious. Some pages may always contain a
group of components arranged in a very specific layout, while other pages may always
use a specific group of components in multiple parts of the page. And at times, you
may want to share some parts of a page or entire pages with other developers.
Whatever the case is, when something changes in the UI, you have to replicate your
changes in many places and pages. Building and maintaining all those pages, and
making sure that some sets or all are consistent in structure and layout can become
increasingly inefficient.
Instead of using individual UI components to build pages, you can use page building
blocks to build parts of a page or entire pages. The building blocks contain the
frequently or commonly used UI components that create the reusable content for use
in one or more pages of an application. Depending on your application, you can use
just one type of building block, or all types in one or more pages. And you can share
some building blocks across applications. When you modify the building blocks, the
JSF pages that use the reusable content are automatically updated as well. Thus, by
creating and using reusable content in your application, you can build web user
interfaces that are always consistent in structure and layout, and an application that is
scalable and extensible.
ADF Faces provides the following types of reusable building blocks:
■ Page fragments: Page fragments allow you to create parts of a page. A JSF page
can be made up of one or more page fragments. For example, a large JSF page can
be broken up into several smaller page fragments for easier maintenance. For
No comments:
Post a Comment