JSF Component development with Rich SuggestionBox
shantanu.u Feb 23, 2011 10:29 AMI'd like to write a JSF component which has :
- rich:suggestionBox
- some h:inputText , and
- some h:selectOneMenu
Here's my stack :
1. JSF 1.1
2. Facelets 1.1
3. RichFaces 3.1.6
I've been searching everywhere to find out how I can make this into REAL component instead of ui:include.
So far, here's what I did to make it into the "component" as one of the ways without extending UIComponent / UIComponentBase / etc
4. Created xhtml for the 'grouped' widgets
5. Declared the xhtml in my taglib.xml ( in <facelet-taglib ...> )
6. Declared the facelet taglib in web.xml
<context-param>
<param-name>facelets.LIBRARIES</param-name>
<param-value>/WEB-INF/wizardui.taglib.xml</param-value>
</context-param>
7. Different pages are able to use this component
<my:customComponent id="someId" binding="#{pageBean.componentHandler}"
eventQueue="ruleQueue" nothingLabel="No matching offers found"
suggestionDelay = "500" style="width: 80%;"
........ />
8. component xhtml takes id attrib and prepends it against all the widget id within - so that I can have 2 or more components in a page
Problem :
9. I don't like this approach - I'd like a real component
10. For each tag, I need a binding i.e. a componentHandler in my page bean
Questions :
11. Is it possible to make a composite control like this ?
12. If so, what will my component class extend - UIPanel or UIComponent or....
13. Do I need a renderer ?
14. When the suggestion fires, will it be handled by the component class ?
15. Is there a link which properly describes what I need to do ? Or a book ? All the links I've seen have simple examples.
16. If I extend UIComponentBase, how do I render the SuggestionBox to the ResponseWriter.
17. When using facelets, do all component need to be declared in the facelet taglib ? Can I use other taglibs ?
18. Since I use XHTML, is the tag writing mechanism for JSPX different ?
Help really appreciated on this. Thank you.