JSF: The Good, the Bad, and Yes, the Ugly
Join the DZone community and get the full member experience.
Join For FreeHaving bagged on JSF quite a bit (mostly for its glacial feature pace), still, after squirming around with it, I find myself liking where it ends up going. This is in large part because I am a big believer in a. binding, b. components, and c. pages that don‘t contain any code. When I get to the finish stage on most ui pieces, I end up doing lots of starts, tuning CSS. Should probably think about taking the html out and fiddling with it in another tool. Thoughts on that are welcome.
In the most recent JSF tour, we were doing a wizard and had to bind to checkboxes. That turned into a nightmare, and for all the typical JSF reasons. JSF gets a low grade for heuristics (intuition is rarely the road to figuring things out). For instance, what would you think would happen if:
- had an entity that has one or more features
- those features each are modeled as Enums
- you want to give the User the ability to checkoff the ones that apply for the given instance of said Entity
Surely, a framework that has been around for 8 years should have no problem with this. Well, in fact, it doesn‘t work. It makes sense that the great Enum converter (more on that, somehow the for-class doesn‘t work on that anymore), would not work for this binding since we are doing a collection, but is this really that complicated? First inclination was to make an EnumSetConverter, after all, the individual Enums were being converted (to its own string format
But that didn‘t work. Turns out there‘s a bug in the 1.2 RI and the converter never gets called. More surprisingly, in the bug discussion, they say that they are going to drop support for converters on checkboxes. The problem is that this leaves you having to bind to some intermediary value, and then perform nothing more than a straight conversion (or write your own component that does support a converter).
Opinions expressed by DZone contributors are their own.
Comments