45
PrimeFaces User Guide
3.59 InputMask..........................................................................................................................265
3.60 InputSwitch........................................................................................................................269
3.61 InputText............................................................................................................................272
3.62 InputTextarea.....................................................................................................................275
3.63 Keyboard...........................................................................................................................280
3.64 Layout................................................................................................................................285
3.65 LayoutUnit.........................................................................................................................290
3.66 LightBox............................................................................................................................292
3.67 Link....................................................................................................................................295
3.68 Log.....................................................................................................................................298
3.69 Media.................................................................................................................................300
3.70 MegaMenu.........................................................................................................................302
3.71 Menu..................................................................................................................................305
3.72 Menubar.............................................................................................................................311
3.73 MenuButton.......................................................................................................................314
3.74 MenuItem..........................................................................................................................316
3.75 Message.............................................................................................................................319
3.76 Messages............................................................................................................................321
3.77 Mindmap............................................................................................................................324
3.78 MultiSelectListbox............................................................................................................327
3.79 NotificationBar..................................................................................................................330
3.80 OrderList............................................................................................................................332
3.81 OutputLabel.......................................................................................................................336
3.82 OutputPanel.......................................................................................................................339
3.83 OverlayPanel.....................................................................................................................341
3.84 Panel..................................................................................................................................344
3.85 PanelGrid...........................................................................................................................347
3.86 PanelMenu.........................................................................................................................350
3.87 Password............................................................................................................................352
3.88 PhotoCam..........................................................................................................................356
3.89 PickList..............................................................................................................................359
3.90 Poll.....................................................................................................................................365
3.91 Printer................................................................................................................................368
3.92 ProgressBar........................................................................................................................369
3.93 RadioButton.......................................................................................................................373
3.94 Rating................................................................................................................................374
3.95 RemoteCommand..............................................................................................................378
3.96 ResetInput..........................................................................................................................381
3.97 Resizable............................................................................................................................383
3.98 Ribbon...............................................................................................................................387
3.99 RibbonGroup.....................................................................................................................390
3.100 Ring.................................................................................................................................391
3.101 Row..................................................................................................................................393
4
45
PrimeFaces User Guide
3.102 RowEditor........................................................................................................................394
3.103 RowExpansion.................................................................................................................395
3.104 RowToggler.....................................................................................................................396
3.105 Schedule..........................................................................................................................397
3.106 ScrollPanel.......................................................................................................................406
3.107 SelectBooleanButton.......................................................................................................408
3.108 SelectBooleanCheckbox..................................................................................................410
3.109 SelectCheckboxMenu......................................................................................................412
3.110 SelectManyButton...........................................................................................................416
3.111 SelectManyCheckbox......................................................................................................418
3.112 SelectManyMenu.............................................................................................................420
3.113 SelectOneButton..............................................................................................................424
3.114 SelectOneListbox.............................................................................................................426
3.115 SelectOneMenu...............................................................................................................429
3.116 SelectOneRadio...............................................................................................................434
3.117 Separator..........................................................................................................................437
3.118 SlideMenu........................................................................................................................439
3.119 Slider................................................................................................................................442
3.120 Spotlight..........................................................................................................................447
3.121 Socket..............................................................................................................................449
3.122 Spacer..............................................................................................................................451
3.123 Spinner.............................................................................................................................452
3.124 SplitButton.......................................................................................................................457
3.125 Submenu..........................................................................................................................462
3.126 Stack................................................................................................................................463
3.127 Steps................................................................................................................................465
3.128 Sticky...............................................................................................................................467
3.129 SubTable..........................................................................................................................469
3.130 SummaryRow..................................................................................................................470
3.131 Tab...................................................................................................................................471
3.132 TabMenu..........................................................................................................................472
3.133 TabView...........................................................................................................................474
3.134 TagCloud.........................................................................................................................479
3.135 Terminal...........................................................................................................................482
3.136 ThemeSwitcher................................................................................................................484
3.137 TieredMenu......................................................................................................................486
3.138 Toolbar.............................................................................................................................489
3.139 ToolbarGroup...................................................................................................................491
3.140 Tooltip..............................................................................................................................492
3.141 Tree..................................................................................................................................495
3.142 TreeNode.........................................................................................................................505
3.143 TreeTable.........................................................................................................................506
3.144 Watermark.......................................................................................................................510
5
45
PrimeFaces User Guide
3.145 Wizard..............................................................................................................................512
4. Partial Rendering and Processing.................................................................................................518
4.1 Partial Rendering.................................................................................................................518
4.1.1 Infrastructure................................................................................................................518
4.1.2 Using IDs.....................................................................................................................518
4.1.3 Notifying Users............................................................................................................520
4.1.4 Bits&Pieces..................................................................................................................520
4.2 Partial Processing................................................................................................................521
4.2.1 Partial Validation..........................................................................................................521
4.2.2 Using Ids......................................................................................................................522
4.3 Search Expression Framework............................................................................................523
4.3.1 Keywords.....................................................................................................................523
4.3.2 PrimeFaces Selectors (PFS).........................................................................................524
4.4 PartialSubmit.......................................................................................................................526
5. Javascript API...............................................................................................................................527
5.1 PrimeFaces Namespace.......................................................................................................527
5.2 Ajax API..............................................................................................................................528
6. Dialog Framework........................................................................................................................530
7. Client Side Validation...................................................................................................................534
7.1 Configuration.......................................................................................................................534
7.2 Ajax vs Non-Ajax................................................................................................................534
7.3 Events..................................................................................................................................535
7.4 Messages..............................................................................................................................535
7.5 Bean Validation...................................................................................................................536
7.6 Extending CSV....................................................................................................................536
8. Themes..........................................................................................................................................541
8.1 Applying a Theme...............................................................................................................542
8.2 Creating a New Theme........................................................................................................543
8.3 How Themes Work..............................................................................................................544
8.4 Theming Tips.......................................................................................................................545
8.5 FontAwesome......................................................................................................................546
9. PrimeFaces Push...........................................................................................................................547
9.1 Setup....................................................................................................................................547
9.2 Annotations..........................................................................................................................548
9.3 API.......................................................................................................................................550
9.4 Socket Component...............................................................................................................550
9.5 Putting It All Together.........................................................................................................551
9.5.1 Counter........................................................................................................................551
9.5.2 FacesMessage..............................................................................................................553
9.6 Tips and Tricks....................................................................................................................555
10. PrimeFaces Mobile.....................................................................................................................556
10.1 Setup..................................................................................................................................556
10.2 Pages..................................................................................................................................557
6
45
PrimeFaces User Guide
10.2 Navigations........................................................................................................................558
10.3 Components.......................................................................................................................559
10.3.1 Content.......................................................................................................................559
10.3.2 Field...........................................................................................................................560
10.3.3 Footer.........................................................................................................................561
10.3.4 Header........................................................................................................................562
10.3.5 InputSlider.................................................................................................................563
10.3.6 Page............................................................................................................................565
10.3.7 RangeSlider................................................................................................................566
10.3.8 Switch (Deprecated)..................................................................................................567
10.4 RenderKit..........................................................................................................................569
10.4.1 AccordionPanel..........................................................................................................569
10.4.2 AutoComplete............................................................................................................569
10.4.3 Button........................................................................................................................569
10.4.4 Calendar.....................................................................................................................570
10.4.5 ConfirmDialog...........................................................................................................570
10.4.6 DataList......................................................................................................................570
10.4.7 DataGrid....................................................................................................................571
10.4.8 DataTable...................................................................................................................571
10.4.9 Dialog........................................................................................................................571
10.4.10 FileUpload...............................................................................................................572
10.4.11 Growl.......................................................................................................................572
10.4.12 InputText..................................................................................................................572
10.4.13 InputTextarea...........................................................................................................572
10.4.14 Link..........................................................................................................................572
10.4.15 Menu........................................................................................................................572
10.4.16 Panel........................................................................................................................572
10.4.17 PanelGrid.................................................................................................................573
10.4.17 SelectBooleanCheckbox..........................................................................................573
10.4.18 SelectCheckboxMenu..............................................................................................573
10.4.18 SelectManyButton...................................................................................................573
10.4.19 SelectManyCheckbox..............................................................................................573
10.4.20 SelectOneButton......................................................................................................573
10.4.21 SelectOneMenu........................................................................................................573
10.4.22 SelectOneRadio.......................................................................................................573
10.4.23 TabMenu..................................................................................................................574
10.4.24 TabView...................................................................................................................574
10.4.25 Toolbar.....................................................................................................................574
10.5 Themes..............................................................................................................................575
10.6 Framework.........................................................................................................................576
10.6.1 Ajax Updates..............................................................................................................576
10.6.2 Pass Through Elements..............................................................................................576
10.6.3 Lazy Pages.................................................................................................................577
7
16
PrimeFaces User Guide
10.6.4 Touch Events..............................................................................................................577
11. Utilities.......................................................................................................................................579
11.1 RequestContext..................................................................................................................579
11.2 EL Functions......................................................................................................................582
11.3 Exception Handler.............................................................................................................583
11.4 BeanValidation Transformation.........................................................................................585
11.5 PrimeFaces Locales...........................................................................................................586
12. Portlets........................................................................................................................................589
13. Right-To-Left..............................................................................................................................590
14. IDE Support................................................................................................................................591
14.1 NetBeans............................................................................................................................591
14.2 Eclipse...............................................................................................................................592
15. Project Resources.......................................................................................................................593
16. FAQ............................................................................................................................................594
8
10
PrimeFaces User Guide
About the Author
Çağatay Çivici is a member of JavaServer Faces Expert Group, the founder of PrimeFaces and
PMC member of open source JSF implementation Apache MyFaces. He is a recognized speaker in
international conferences and many local events such as JUGs.
Çağatay is also an author and technical reviewer of a couple books regarding web application
development with Java and JSF. As an experienced trainer, he has trained over 300 developers on
Java EE technologies mainly JSF, Spring, EJB 3.x and JPA.
Çağatay is also known as Optimus in JavaServer Faces Community.
9
14
PrimeFaces User Guide
1. Introduction
1.1 What is PrimeFaces?
PrimeFaces is an open source JSF component suite with various extensions.
•Rich set of components (HtmlEditor, Dialog, AutoComplete, Charts and many more).
•Built-in Ajax based on standard JSF Ajax APIs.
•Lightweight, one jar, zero-configuration and no required dependencies.
•Push support via Atmosphere Framework.
•Mobile UI kit to create mobile web applications.
•Skinning Framework with 35+ built-in themes and support for visual theme designer tool.
•Extensive documentation.
•Large, vibrant and active user community.
•Developed with "passion" from application developers to application developers.
10
Documents you may be interested
Documents you may be interested