Oh, I'm not really mad at JSF, though I do think it is a much more complicated framework to deal with than Spring MVC, for instance. It's much like using ANT or PHP - there's a size threshold your project seems to cross where suddenly it's taking longer to figure out what badness the framework is doing than to actually be productive. I'll caveat that with the fact that I've only used JSF 1.1 spec frameworks, and I'm sure 1.2 and 2.0 spec are probably easier to use and understand.
As to the using something other than a component that generates an HTML select element, the whole point of the article is that there is no combobox component implementation for JSF, and those of us that work for a living and have families simply don't have the time to write one ourselves, and so I've shared this shortcut I figured out that can save developers a lot of time. If I used the UIInput as you suggested, ExtJS would not be able to create a proper combobox from it, and so the UISelect extended SelectOneMenu was the only option. Yes ExtJS injects "strange" code, but I've found it to work nicely and play well with all the JSF functionality so far, so what's the harm?
I don't agree that the submitted option matching validation had to be hardcoded. That code could have been implemented as a default validator that could be removed by the implementor, thereby giving the API users full control over what validation was done when and to what. Again, this is for the 1.1 implementation, and I don't know what the >1.1 versions do.
As for taking offence, I rarely do. If JSF's learning curve is so high it takes weeks to understand it properly, and if I've found every other framework I've worked with - Spring MVC, Struts 1.x, Struts 2.x, Webwork, Stripes, Wicket, and Django (during my summer flirtation with python) to be easier to understand, implement, and manage, then yes, I do not understand JSF very well at all. And you know what? - that's ok! If you find JSF to be your alpha and omega framework, then I'm happy for you. As for me, JSF is costing me time while trying to figure out stuff that is "Intuitively Obvious To The Most Casual Observer" in most other frameworks. And yet at the end of the day, I get paid for the time I've spent working through the source, so I'm not really bothered by it.
I'll leave you with a quote by Alexander Pope:
"At every trifle take offence, that always shows great pride or little sense."
John O'Grady, Dragon Tamer
The important thing is not to stop questioning. - Albert Einstein
From: email@example.com On Behalf Of Jakob Korherr
Sent: Wednesday, January 13, 2010 2:51 PM
To: MyFaces Discussion
Subject: Re: JSF Combo Box for MyFaces 1.1 - one humble developer's solution
I think it would be better for yourself to (try to) understand the concepts of JSF's standard components first, before you write a blog post in which you do nothing but swearing about JSF.
If you use an UISelect component, then you have to be aware of the fact that this component matches the submitted values against the possible values. So it has to be a hardcoded validation.
So if you want a component, which does not check this, you should use the an UIInput component (like HtmlInputText).
Furthermore if you want to implement a combo box for JSF, it would be A LOT better to write a custom component then to use the binding attribute to inject strage code into the component. But that's a thing you would know, if you'd understand JSF, which you clearly don't. No offence.
You might want to take a look at the some online books about JSF, like http://jsfatwork.irian.at/semistatic/introduction.html
(written in German).
2010/1/13 Ogrady, John <firstname.lastname@example.org>
Wrote up my solution for a JSF combo box - and yes, this is a
shameless, egotistical plug for my blog, but the solution is sound. Click on the link.
You know you want to!http://mytechhell.com/blog/archives/432
Suggestions, corrections, and relevant puns greatly accepted and
sometimes even appreciated...
Human beings, who are almost unique in having the ability to learn
from the experience of others, are also remarkable for their apparent
disinclination to do so.
- Douglas Adams
Those who do not learn from history are doomed to repeat it.
- George Santayana
Qui tacet consentit
(Silence implies consent)