USER GUIDE
6.0
Author
Çağatay Çivici
First Edition
PrimeFaces User Guide
Table of Contents
About the Author.................................................................................................................................. 9
1. Introduction.................................................................................................................................... 10
1.1 What is PrimeFaces?............................................................................................................. 10
2. Setup............................................................................................................................................... 11
2.1 Download...............................................................................................................................11
2.2 Dependencies.........................................................................................................................12
2.3 Configuration.........................................................................................................................13
2.4 Hello World........................................................................................................................... 13
3. Component Suite............................................................................................................................ 14
3.1 AccordionPanel......................................................................................................................14
3.2 AjaxBehavior.........................................................................................................................19
3.3 AjaxExceptionHandler.......................................................................................................... 22
3.4 AjaxStatus..............................................................................................................................23
3.5 AutoComplete........................................................................................................................26
3.6 Barcode..................................................................................................................................36
3.7 BlockUI................................................................................................................................. 39
3.8 BreadCrumb.......................................................................................................................... 42
3.9 Button.................................................................................................................................... 44
3.10 Cache................................................................................................................................... 47
3.11 Calendar...............................................................................................................................49
3.12 Captcha................................................................................................................................59
3.13 Carousel...............................................................................................................................62
3.14 CellEditor............................................................................................................................ 68
3.15 Chart.................................................................................................................................... 69
3.15.1 PieChart....................................................................................................................... 70
3.15.2 LineChart..................................................................................................................... 72
3.15.3 BarChart.......................................................................................................................75
3.15.4 DonutChart.................................................................................................................. 77
3.15.5 BubbleChart.................................................................................................................79
3.15.6 Ohlc Chart....................................................................................................................81
3.15.7 MeterGauge Chart....................................................................................................... 83
3.15.8 Combined Chart...........................................................................................................85
3.15.9 Multiple Axis............................................................................................................... 86
3.15.10 Date Axis................................................................................................................... 88
3.15.11 Interactive Chart........................................................................................................ 89
3.15.12 Export........................................................................................................................ 90
3.15.13 Static Images..............................................................................................................91
3.15.14 Skinning.....................................................................................................................92
3.15.15 Extender.....................................................................................................................93
3.15.16 Chart API................................................................................................................... 94
3.16 Checkbox.............................................................................................................................99
3.17 Clock..................................................................................................................................100
2
PrimeFaces User Guide
3.18 Collector............................................................................................................................ 102
3.19 Color Picker.......................................................................................................................103
3.20 Column.............................................................................................................................. 106
3.21 Columns.............................................................................................................................108
3.22 ColumnGroup.................................................................................................................... 110
3.23 ColumnToggler.................................................................................................................. 111
3.24 CommandButton................................................................................................................112
3.25 CommandLink................................................................................................................... 117
3.26 Confirm..............................................................................................................................121
3.27 ConfirmDialog...................................................................................................................122
3.28 ContentFlow...................................................................................................................... 125
3.29 ContextMenu..................................................................................................................... 127
3.30 Dashboard..........................................................................................................................130
3.31 DataExporter......................................................................................................................135
3.32 DataGrid............................................................................................................................ 138
3.33 DataList............................................................................................................................. 145
3.34 DataScroller.......................................................................................................................149
3.35 DataTable...........................................................................................................................153
3.36 DefaultCommand.............................................................................................................. 178
3.37 Diagram............................................................................................................................. 180
3.38 Dialog................................................................................................................................ 184
3.39 Drag&Drop........................................................................................................................189
3.39.1 Draggable...................................................................................................................189
3.39.2 Droppable.................................................................................................................. 193
3.40 Dock.................................................................................................................................. 198
3.41 Editor................................................................................................................................. 200
3.42 Effect................................................................................................................................. 204
3.43 FeedReader........................................................................................................................207
3.44 Fieldset.............................................................................................................................. 208
3.45 FileDownload.................................................................................................................... 211
3.46 FileUpload......................................................................................................................... 213
3.47 Focus..................................................................................................................................220
3.48 Fragment............................................................................................................................222
3.49 Galleria.............................................................................................................................. 224
3.50 GMap.................................................................................................................................227
3.51 GMapInfoWindow.............................................................................................................239
3.52 GraphicImage.................................................................................................................... 240
3.53 Grid CSS............................................................................................................................244
3.54 Growl.................................................................................................................................247
3.55 HotKey.............................................................................................................................. 251
3.56 IdleMonitor........................................................................................................................254
3.57 ImageCompare.................................................................................................................. 256
3.58 ImageCropper....................................................................................................................258
3
PrimeFaces User Guide
3.59 ImageSwitch......................................................................................................................262
3.60 ImportConstants................................................................................................................ 265
3.61 ImportEnum.......................................................................................................................266
3.62 Inplace............................................................................................................................... 267
3.63 InputMask..........................................................................................................................271
3.64 InputNumber......................................................................................................................275
3.65 InputSwitch........................................................................................................................279
3.66 InputText............................................................................................................................282
3.67 InputTextarea.....................................................................................................................285
3.68 Keyboard........................................................................................................................... 290
3.69 KeyFilter............................................................................................................................295
3.70 Knob.................................................................................................................................. 297
3.71 Layout................................................................................................................................300
3.72 LayoutUnit.........................................................................................................................305
3.73 LightBox............................................................................................................................307
3.74 Link....................................................................................................................................310
3.75 Log.....................................................................................................................................313
3.76 Media.................................................................................................................................315
3.77 MegaMenu.........................................................................................................................317
3.78 Menu..................................................................................................................................320
3.79 Menubar.............................................................................................................................326
3.80 MenuButton.......................................................................................................................329
3.81 MenuItem.......................................................................................................................... 331
3.82 Message............................................................................................................................. 334
3.83 Messages............................................................................................................................336
3.84 Mindmap............................................................................................................................339
3.85 MultiSelectListbox............................................................................................................ 342
3.86 NotificationBar..................................................................................................................345
3.87 OrderList............................................................................................................................347
3.88 OutputLabel.......................................................................................................................351
3.89 OutputPanel....................................................................................................................... 354
3.90 OverlayPanel..................................................................................................................... 356
3.91 Panel.................................................................................................................................. 359
3.92 PanelGrid...........................................................................................................................362
3.93 PanelMenu.........................................................................................................................365
3.94 Password............................................................................................................................367
3.95 PhotoCam.......................................................................................................................... 371
3.96 PickList..............................................................................................................................374
3.97 Poll.....................................................................................................................................381
3.98 Printer................................................................................................................................ 384
3.99 ProgressBar........................................................................................................................385
3.100 RadioButton.....................................................................................................................389
3.101 Rating.............................................................................................................................. 390
4
PrimeFaces User Guide
3.102 RemoteCommand............................................................................................................394
3.103 Repeat..............................................................................................................................397
3.104 ResetInput........................................................................................................................398
3.105 Resizable..........................................................................................................................400
3.106 Ribbon............................................................................................................................. 404
3.107 RibbonGroup................................................................................................................... 407
3.108 Ring................................................................................................................................. 408
3.109 Row..................................................................................................................................411
3.110 RowEditor........................................................................................................................412
3.111 RowExpansion.................................................................................................................413
3.112 RowToggler..................................................................................................................... 414
3.113 Schedule...........................................................................................................................415
3.114 ScrollPanel.......................................................................................................................425
3.115 SelectBooleanButton....................................................................................................... 427
3.116 SelectBooleanCheckbox..................................................................................................429
3.117 SelectCheckboxMenu......................................................................................................432
3.118 SelectManyButton........................................................................................................... 436
3.119 SelectManyCheckbox......................................................................................................438
3.120 SelectManyMenu.............................................................................................................441
3.121 SelectOneButton..............................................................................................................445
3.122 SelectOneListbox............................................................................................................ 447
3.123 SelectOneMenu............................................................................................................... 450
3.124 SelectOneRadio............................................................................................................... 456
3.125 Separator..........................................................................................................................459
3.126 Signature..........................................................................................................................461
3.127 SlideMenu........................................................................................................................466
3.128 Slider................................................................................................................................469
3.129 Spotlight.......................................................................................................................... 474
3.130 Socket.............................................................................................................................. 476
3.131 Spacer.............................................................................................................................. 478
3.132 Spinner.............................................................................................................................479
3.133 SplitButton.......................................................................................................................484
3.134 Submenu..........................................................................................................................489
3.135 Stack................................................................................................................................ 490
3.136 Steps................................................................................................................................ 492
3.137 Sticky...............................................................................................................................494
3.138 SubTable..........................................................................................................................496
3.139 SummaryRow..................................................................................................................497
3.140 Tab................................................................................................................................... 498
3.141 TabMenu..........................................................................................................................499
3.142 TabView...........................................................................................................................501
3.143 TagCloud......................................................................................................................... 506
3.144 Terminal...........................................................................................................................509
5