JSF component libraries provide you with a solid basis for building enterprise UIs as they are covering most common use cases. But what can you do in a case that no existing component fits your project requirements?
There are many JavaScript component projects which offer together nearly infinite possibilities. But it might not be evident that leveraging these JavaScript frameworks is as easy as writing plain old HTML code, separating component and page development efforts. But how to wrap these components to fit into JSF eco-system?
That’s exactly where RichFaces CDK comes into play.
22. “This is source code of JSF component
a4j:commandLink.”
“Let's look at the fragment.”
23. “The component is interface with list attributes,
Represented as getters/setters of the component
class”
“Each getter and setter just delegates to StateHelper
to keep the state of the component between subsequent
requests”
25. “A renderer is responsible for translating
the component to the page representation
and then encoding the user input back to the
component instance”
Component
Renderer
26. “A renderer is as verbose as
component code,
let's look at the sample of
h:dataTable component's
code”
27. “The renderer uses ResponseWriter
to add elements, attributes and text
content to the page.”
“The Java representation of the
renderer is very verbose, which leads
to readability and maintainability
concerns.”
28. What is component?
Tag
Component interface
Renderer
XML descriptors
● taglib.xml
29. “taglib.xml descriptor is responsible for binding
the component from the page template
to the component class”
Component
Renderer
30.
31. What is component?
Tag
Component interface
Renderer
XML descriptors
● taglib.xml
● faces-config.xml
43. But they don't replace full-fledged component
development
44. Full-Fledged Development?
Tag
XML descriptors
● faces-config.xml
● taglib.xml
Component interface
Renderer
Documentation
“So it means we need to get stuck with
full-fledged component development?”
45. What we actually need?
Tag
XML descriptors
● faces-config.xml
● taglib.xml
Component interface
Renderer (XML)
Documentation
“Let's imagine that the most of the informations
are duplicates, which are actually expressed
by Component interface”
46. “And at this point, you recognize that some toolkit
may be needed to do the job!”
47. “Which is exactly what RichFaces CDK offers!”
RichFaces CDK
Component Development Kit
48. RichFaces CDK
● Renderer
● XML Templates
● with syntax very close to Composite Components
● Generated in the build-time
● with Convention-over-Configuration in mind
49. But it is build-time tool, right?
Is it not too heavy-weight to use in development?
50. Rapid Turnaround
● You can just use your IDE
● And let Java Hot Deployment solutions to do
the job
● JRebel works very nice here
51. Resource Development
● But Resources are as needed to develop
rapidly as component/renderer code
● JavaScript
● CSS
● Hot Deployment
● using JSF application Development stage
56. Right level of abstraction
● Let's take
● favorite UI widget
● or favorite widget set
● Expose it to JSF
57. Don't reinvent a wheel!
● When you want RichFaces component bend to
use for your needs...
● Take the component from GitHub
● Fork the component
● It's just matter of one click with GitHub!
● Make it work as you need
58. Publish Your Work
● Let others
● review it
● find bugs
● Cooperate with others
● More knowledge
● Get bugs fixed
59. “And when you want to be part of the successful
community, you can go and open the source!”
The Open Source Way
RichFaces Sandbox
“That's exactly how RichFaces Sandbox works.”
61. “RichFaces team is investigating integration
In direction of several of open-source
JavaScript UI widgets.”
Bootstrap
“The RichFaces Sandbox is used as part of this effort.”
65. “Photographs used in presentation
have been authored by various authors,
published under Creative Commons license”
http://www.flickr.com/photos/lonelyplanetexchange/2416006280/
http://www.flickr.com/photos/davidbolton/4454944721/
http://www.flickr.com/photos/bjvs/4283146424/
http://www.flickr.com/photos/egansnow/288478628/
http://www.flickr.com/photos/negativz/74267002/
http://www.flickr.com/photos/kyknoord/5333012356/
http://www.flickr.com/photos/wilhei/109403306/
http://www.flickr.com/photos/kalmyket/691478431/
http://www.flickr.com/photos/friarsbalsam/4609210182/
http://www.flickr.com/photos/paul_lowry/2266388742/
http://www.flickr.com/photos/breatheindigital/4689159475/
http://www.flickr.com/photos/eschipul/206714304/