Saturday, February 18, 2012

Primefaces

JSF comes with some basic components, but to get the most out of JSF, you will need to create your own custom components, or use a component library.  Primefaces is one such library that has many great components and they have AJAX built in.  In this application, we used menus, dialog boxes, command buttons, data tables, a tree, input boxes, output boxes, and display panels.  We presented icons on our menu items and buttons.  And we used AJAX throughout the application.  There are many other components in the primefaces showcase.  We also used one of their custom skins for a different look and feel (outcast.jar) which was configured in the web.xml.

The lables Primefaces use don't always match what you may expect, i.e. you use update= instead of render= for an ajax update of a component.  But, once you know it, it is quite simple to map the information, and much of that can be gotten directly from their showcase samples.

Review StartPage.xhtml in JSF Continued for samples of how each component was implemented.

Note:  do not update the dialog box, it stops working if you do.  Instead update the component (i.e. panel) or form in the dialog box to refresh the display.

No comments:

Post a Comment