PrimeFaces Theme Development
上QQ阅读APP看书,第一时间看更新

Chapter 2. Introducing PrimeFaces Themes

In order to be able to experience using JSF and the PrimeFaces library, we are going to continue our work from the last chapter and add to the PFThemes project. By the end of this chapter, you will have a deeper understanding of how even a simple JSF application can be greatly enriched by using PrimeFaces components in it. In particular, I will demonstrate how PrimeFaces provides a powerful themes framework.

In this chapter, we will cover the following topics:

  • The difference between standard JSF and PrimeFaces components
  • Adding additional themes to the project
  • Changing the theme used by the project
  • Displaying the name of the theme used by the project
  • Adding some classes to allow us to use the ThemeSwitcher component
  • Changing web.xml so that it supports dynamic themes
  • Creating a Facelets Template and adding a menu for navigation and a ThemeSwitcher to it
  • Creating a page that uses this template and adding some components to it
  • Adding a link to this page in the template
  • Displaying the name of the theme that is currently being used in the template
  • Adding some buttons to the page to switch themes without using the ThemeSwitcher