a4j
advanced execute options
<a4j:region>, 62
advanced partial view rendering options (see Advanced partial view rendering options)
Ajax status (see Ajax status)
<a4j:commandButton> and <a4j:commandLink>
adding execute attribute, 44
Ajax attributes, 46
Ajax behavior, 43
execute attribute, 46
input fields, 44
managed bean code, 44
RichFaces, 45
different components, events combining, 72–73
JavaScript function
<a4j:jsFunction>, 47
HTML tag, 46
JSF programmatic Ajax approach, 49
#{jsFunctionNameBean.name} property, 49
managed bean, 49
render attribute, 48
sendAjaxRequest(), 48
server, data receiving, 48
logging and debugging information, 80, 82
passing parameters
<a4j:param>, 49
bean property, 51
<f:param>, 50
JSF code, 49
onmouseout event, 50
onmouseover event, 50
param1, param2, and param3 form, 51
setdrink, 50
same component, events combining
context parameter, 71
managed bean, 69
org.richfaces.queue.global, 71
rendered page, 68
request execution, 68
traffic control, client queue
<a4j:attachQueue>, 67
definition, 66
form-level queue, 67
named queue, 67
RichFaces queue, 66
standard Ajax queue, 65
Accordion
code, 146
customized accordion control, 146
events and listeners, 147
item headers, 147
JavaScript API, 148
simple accordion control, 145
Advanced partial view rendering options
<a4j:outputPanel>
Ajax updates, 57
ajaxRendered="true" attribute, 55
auto-rendered panel, 57
block value, 59
component re-rendering, 56
components wrapping, 55
#{dynamicUpdateBean.display}, 56, 57
<h:panelGrid>, 58
JSF page, 56
managed bean, 57
page code, 58
placeholder, 57
render attribute, 55
RichFaces, 55
table, hide/show, 56
bypassUpdates attribute
bypassUpdates Attribute, 36
displayed console, 35
JSF life cycle diagram, 34
JSF page, 37
managed bean, 34
phase listener, 35
register.xhtml page, 33
registration form, 33
Render Response phase, 37
Web application, 33
core functionality, 25
dynamic render
#{bean.renderComponents}, 30
clocks, 28
execute attribute options, 32–33
init() method, 30
updated selectComponents method, 30
<f:ajax> behavior, 18
JavaScript interactions
JavaScript function, 39
JSF page, 38
onerror attribute, 41
onerror callback event, 41
RichFaces callback events, 41
standard Ajax request callback events, 38
sub-event alert dialog, 40
sub-events descriptions, 38
partial view processing
example code, 23
listener attribute, 24
managed bean, 23
predefined value @form, 25
render attribute, 27
status
absolute positioning, 77
code, 77
definition, 75
JSF page, 76
manage bean, 76
named status, 78
request, 75
start facet, 78
startText and stopText attributes, 75
style attribute, 77
Back to Server Validation, 312
Bean validation
constraints, 305
error messages, 307
JSF page, 306
CDK: Building Custom Components, 355
Client-side JavaScript API, 91
activeItem attribute, 91
JSF page with buttons, 93
JSF server-side framework, 91
managed bean with action, 92
page code, 92
reference and method name, 92, 93
RichFaces components guide, 92
Client-side validation
messages/error messages
auto-rendered message, 309
icons, 309
layout, 311
summary and details styling, 310
updated page, 307
validator, 308
Collapsible panels
and expanded panel, 136
indication icons, 137
JavaScript API, 139
PanelToggleEvent, 138
switchType attribute, 138
Component Development Kit (CDK)
abstract component class, 365
@Attribute properties, 366
@JsfComponent properties, 365
spinner component, 365
UISpinner class, 367
client-side prototyping, 357
add script to HTML template, 360
DOM elements, 359
HTML prototype, 357
interactive spinner HTML prototype, 360
jQuery plug-in, 358
common attributes, 377
component code, 379
spinner.template.xml <cc:interface>, 378
template implementation, 379
update sample application code, 379
XML fragments from CDK, 377
component classes, 356
component renderer template, 368
<cc:implementation> section, 369
<cc:interface> section, 369
<cdk:object> tag, 369
<cdk:scriptObject> tag, 369
<cdk:scriptOption> tags, 369
encode, 372
getInputValue()method, 371
org.richfaces.book.renderkit package, 370
purposes, 368
spinner.template.xml, 368
components library, 364
development plan, 356
disabled state, 379
events, listeners, and behaviors, 356
Maven project, 360
command, 361
JBoss artifacts, 361
list of dependencies, 361
plug-in, 362
structure, 363
renderer classes, 356
renderer template tags, 372
<cc:implementation> section, 373
<cc:interface> section, 372
cdk:passThrough, 374
cdk:passThroughWithExclusions, 374
JSTL tags, 374
sample application, 375
erroneous entry, 376
index.xhtml page, 376
renderedspinner component, 377
richfaces-archetype-simpleapp archetype, 375
spinner dependency, 375
skinning, 381
class encoding, 381
emeraldTown, 382
skinned spinner component, 382
stylesheet with spinner.ecss, 381
XML configuration, 356
CSS
class names, 345
properties, 340
Drag and drop
Ajax request status, 289
code, 288
CSS classes, 296
custom static content, 297
default drag indicator, 296
drop zone, 288
image component draggable, 287
page, 297
server-side listener on drop, 289
shopping cart, 290
bean, 291
checkout page, 293
drop listener method, 293
initial page code, 291
product object, 290
product page, 292
tree components, 299
bean, 299
drop listener method, 302
JSF page, 300
nodes draggable, 302
Swing's TreeNode, 299
updated page, 301
two-way drag-and-drop operations, 294
method code, 294
modified panel with shopping cart, 295
modified products panel, 294
two items added to the cart, 295
type attribute, 288
updated code, 289
within tables, 303
Drag-and-Drop Components, 287
ECSS files, 341
Fetching algorithm, 103
Inplace input component, 90
Java architecture for XML binding (JAXB), 176
JavaScript API
<a4j:param>, 321
<rich:componentControl>, 321
#rich:component(id) function, 317
accordion, 319
page code, 319
popup panel, 317
switching buttons, 319
updated popup, 318
<rich:hashParam>, 322
JavaServer Faces (JSF)
Ajax functionality, 4
compatibility matrix, 9
definition, 3
DOM update, 11
extendibility feature, 4
HTML tags, 3
Mojarra, 3
MyFaces, 3
standard, 3
Struts, 12
user interface (UI) components, 3–5
versions, 3
web applications, 4
jQuery
DOM, 326
hide() function, 328
named query, 330
page, 328
panel, 326
second argument, 330
updated panel, 326
zebra styled table, 329
JSF components. See Component Development Kit (CDK)
JSF page code, 86
Mojarra, 3
MyFaces, 3
Popup panel
header controls, 155
JavaScript API, 168
open/close
click/change, 156
component customization, 157
content updates, 159
modal popup, 153
non-modal state, 157
server-side action, 157
operation status, 165
panel header, 154
panel type, 153
performance, 167
table, 163
wizard, 160
Rich components, 85
Ajax request, 85
Ajax behavior, 91
client event handler, 91
inplace input component, 90
JSF page with tab panel, 89
managed bean, 89
time component outside tab panel, 90
API (see Client-side JavaScrip API)
features, 86
label state, 85
render attribute, 89
<rich tabPanel>, 86
using facets, 86
<h:panelGrid>, 88
<h:panelGroup>, 88
header attribute, 87
JSF page code, 86
list, 88
rich tab panel, 86
RichFaces component guide, 88
switchType attribute, 87
Rich data iteration components, 175
ArrangeableModel implementation, 238
append*() method, 241
BaseArrangeableHibernateModel, 239, 240
BasePageableModel, 238
filtered and sorted table, 243
FilteringBean, 239
getRowCount() method, 240
simple concrete object model class, 242
sortBy and filterExpression properties, 239
table, initial rendering, 242
trimmed methods, 241
data preparation
application scoped bean, 230–231
BaseDescriptor, 230
GameDescriptor object, 176–177
GameParser.java class, 178
GamesDescriptors list, 179
hibernate configuration file, 229
Hibernate Core (version 3.6.2), 228
HibernateUtils, 231
HSQLDB (version 1.8.0.2 ), 228
JAXB, 176
ExtendedDataModel implementation
abstract class, 232
cachedRowCount bean property, 234
<c:forEach> usage, 236
dynamic columns, 237
footer facet, 236
isRowAvailable() method, 234
JSF DataModel, 232
PageableHibernateModel class, 235
process() method, 235
setRowIndex(index) method, 234
grid, displaying data, 196–197
<h:dataTable> component, 175
iteration components advanced models, 228
list, displaying data, 194–196
partial table updates
<a4j:commandButton>, 208
addDiscount method, 208
Ajax component, 205
discount column and button, 207–208
partial-table rendering, 207
render attribute, 207
<rich:dataTable> and <rich:extendedDataTable>, 209
@rows(rowKeysCollection) function, 207
SalesItem object code, 205
SalesReport bean code, 206
request variables
assignTo attribute, 211
iterationStatusVar variable, 209, 212, 213
Java code, 211
<rich:dataScroller>
for attribute, 200
JavaScript API, 204
look and feel customization, 201–202
multiple scrollers, 200
page attribute, 200
rows attribute, 199
table pagination control, 198
collapsible data table, 183–184
complex header structures, 182
JavaScript API, 187
look-and-feel customization, 180–182
master-details tables, 185–187
nested sub-tables, 182
OlympicGamesBean bean, 184
<rich:columnGroup> component, 184
rowspan, 184
<rich:extendedDataTable>, 188
<a4j:ajax>, 192
clientRows attribute, 190
column resize feature, 188
frozenColumns attribute, 190
Java code, 192
JavaScript API, 193
row data selection, 193
row selection control, 191
scrolling feature, 189
selectionMode attribute, 191
table filtering, 225
CenturyFilter object, 225
cityFilteringString and countryFilteringString properties, 225
cityFinteringString and countryFilteringString properties, 224
filter() API method, 227
filterExpression, 223
GameDescriptor, 225
JavaScript API, 227
noDataLabel attribute, 227
org.richfaces.model.Filter<T> interface, 223
single accept(T t) method, 223
table sorting, 218
<a4j:commandLink> control, 216
comparator, 214
date object comparator method, 216
external controls, 213
resetSorting method, 219
<rich:componentControl>, 220
simple text indication, 221–222
sort() method, 219
sortPriority attribute, 218
<ui:repeat> component, 175
Rich input and select components
#{calendarBean.today}, 117
calendar component, 117
calendar internationalization
calendar labels attributes, 120
calendar message bundle keys, 120
faces-config.xml, 121
Italian locale, 121
Java source root folder, 121
UI labels localization, 120
client-side customization
component facets, 128
data model, client side, 125
dayClassFunction and dayDisableFunction, 125
JavaScript API, 127
<rich:calendar>, 126
<rich:component(id)>, 127
default label support, 96
month selection, 118
rendered inline, 119
<rich:autocomplete>
additional button rendering, 105
autocompleteList attribute, 104
autocompleteMethod, 104
Client, 103
client-side filter customization, 106
fetching algorithm, 103
fetchValue, 109
JavaScript API, 110
JSF page, 108
layout attribute, 109
Lazy Client, 103
minChars condition, 105
<rich:suggestionBox> and rich:comboBox components, 103
selectFirst attribute, 105
state class, 108
tokens, 105
<rich:fileUpload>
<a4j:ajax>, 131
asynchronous file input features, 128
component facets, 132
files uploading, 130
fileUploadListener, 129
JavaScript API, 132
JSF page code, 129
managed bean snippet, 131
simple managed bean, 129
standard <h:form>, 129
UploadedFile interface methods, 129
web xml context-parameters, 129
web.xml context parameters, 130
<rich:inplaceInput>
Ajax behavior, 98
Ajax request, 97
change in value, 97
component switches, 96
default labels, 97
editEvent attribute, 98
handlers attributes, 97
input field, 96
input save/cancel control, 97
JavaScript API, 98
managed bean, 96
onchange event attribute, 97
saveOnblur property, 98
saveOnBlur="false", 98
spreadsheet functionality, 98
standard conversion and validation rules, 98
standard input component, 96
<rich:inplaceSelect>
component activated, 99
defaultLabel attribute, 100
dependent select component, 100
drop-down list, 99
edited value, save/cancel, 100
edited value, save/cancelclient-side event handlers, 100
<f:selectItem> or <f:selectItems> tag, 100
#{inplaceSelectBean.fruit}, 100
Java bean, 101
JavaScript API, 102
JSF page code, 99
saveOnSelect and saveOnBlur, 102
single string property, 100
<rich:inputNumberSlider>
custom boundary values, 114
disabled attribute, 116
disabled manual input, 114
enableManualInput attribute, 114
input field completely, 115
InputNumberBean code, 114
inputPosition attribute, 115
JavaScript API, 116
showArrows attribute, 115
showBoundaryValues, 116
<rich_inputnumberspinner>, 116
<rich:select>
client-side operation, 111
dynamic <rich:select> components, 113
enableManualInput="true", 111
<h:selectOneMenu> component, 111
JavaScript API, 113
JSF page, 112
pop-up selection, 111
standard UISelectOne component, 110
unchanged managed bean code, 112, 113
server-side customization
Ajax mode, 122
calendarDataModel Item Interface, 122
client mode, 122
JSF page code, 123
time selection, 119
Rich menu components, 245
<rich:dropDownMenu>
drop-down menu code, 251
JavaScript API, 256
JavaScript handler methods, 252
JSF page, 253
managed bean, 252
menu items, 255
menuSelected property, 253
open file item, 253
popup panel, 254
#{rich:component('about')}.show(), 254
<rich:menuGroup> and <rich:menuSeparator>, 255
standard Ajax concepts, 251
standard POST request, 251
undo item, 253
<rich:panelMenu>
activeItem attribute, 262
bubbleSelection, 259
file group expansion, 262
group definition, 263
icon attributes, 259
item definition, 263
JavaScript API, 264
managed bean code, 261
menu items, modification, 263
menu rendering code, 258
mode attributes, 260
open file menu item activation, 262
popup addition, 263
popup panel opening, 263
server-side events, 260
standard and custom icons, 259
standard RichFaces icons, 259
<rich:toolbar>
<a4j:outputPanel>, 246
bean code, 247
built-in separators, 247
click-handling behaviors, 249
custom separator, 247
<h:panelGroup>, 248
items grouping, 248
items separator, 247
<rich:panel>, 245
simple toolbar code, 246
skins CSS, 246
toolbar, JSF component, 249
UserBean code, 250
width and height, 246
Rich tab panel component, 86
Rich tree components, 265
expansion event handling, 277–278
RichFaces tree, 265
RichFaces TreeNode interface
<rich:tree> building, 271
bean, 270
ExtendedDataModel, 269
isLeaf() method, 271
org.richfaces.model.TreeNode interface, 269
root node, 270
TreeNodeImpl implementation, 269
<rich:treeModelAdaptor>
page code, 282
<rich:treeNode>, 283
<rich:treeModelRecursiveAdaptor>
base FileSystem node class, 283–284
directories list, 285
file system representation, 283
nodes attribute, 285
rootDirs, 285
roots attribute, 283
trees rendering, 285
selection event handling, 276–277
swing TreeNode interface
<rich:tree> building, 268
org.richfaces.model.TreeNode interface, 266
page code, 268
SwingTreeNodeImpl class, 266–267
tree nodes lazy loading
getRowData() method, 280
org.richfaces.model.TreeNode-based model, 278–279
tree with child nodes, 280
tree without child nodes, 279
UITree instance, 280
tree toggling and selection modes, 275
types of nodes
adding another property, 272
custom nodes, 274
nested <rich:treeNode> tags, 274
var attribute, 274
Rich validation
Bean validation, 305
client-side validation, 307
graph validator, 313
RichFaces
code generation, 16
Java classes, 15
JavaServer Faces (JSF) 2 project
Ajax (see Ajax)
Apache Maven, 13
caching dependencies, 15
component development kit (CDK) annotations dependencies, 15
integrated development environment, 13
JAR files, 14
validation dependencies, 14
JBoss 6 server, 16
JBoss tools, 16
standard Maven project structure, 16
Tomcat, 16
RichFaces. See also JavaServer Faces (JSF)
a4j, 1
client-side validation, 9
compatibility matrix, 9
component development kit (CDK), 10
contexts and dependency injection (CDI), 10
rich inplace input component, 3
skins, 9
tab panel and calendar components, 1, 2
tag libraries, 9
Simple Rich panels
code, 133
header, 134
mouseover event, 135
nested panels, 135
Skins
blueSky skin, 335
code, 336
custom skin, 338
dynamically changing skins, 346
newyork.skin.properties file, 339
org.richfaces.skin, 334
out-of-the-box skins, 333
parameters, 339
redefined skin-based CSS classes, 342
#{richSkin} implicit object, 351
ruby skin, 334
skin-based CSS, 341
source, 335
standard controls skinning, 347
user-defined style, 345
web.xml file, 338
Standard controls skinning
context parameter, 348
HTML tags, 349
JSF page, 347
org.richfaces.enableControlSkinningClasses, 348
.rfs-txt-general, 350
StartClock method, 54
Tabbed panels
activeItem attribute, 141
code, 140
custom headers, 140
events and listeners, 141
Java bean code, 142
JavaScript API, 144
simple tab panel, 139
switched tab panel, 143
Themes. See Skins
Toggle panel
code, 149
custom tab panel, 151
Einstein button, 151
initial state, 148
JavaScript API, 152
name attribute, 150
Tooltip
body text, 169
city name, 168
data iteration components, 172
followMouse, 169
JavaScript API, 173
loading label, 169
server time and counter, 170
simple tooltip, 168
18.191.181.36