Wednesday, July 21, 2010

Continuing Impressions of JSF 2.0 Cookbook


7/16/2010 9:36:01 PM


 

After just having gone through the selectOneMenu custom car converter example, I have to admit it does seem to use JSF to best advantage. I have often wondered why SelectItem takes an Object as its key value. I kept thinking: why isn't this just a String? This example answers that question. I learned that a converter is called for each item in the select list to come up with the options element values within the generated select list.


 

This must be one of those powerful examples that the author was speaking of in his forward. Nice! I am glad to have this example as a reference, and look forward to trying to these list concepts right from now on.


 

7/18/2010 7:41:48 PM

OK, the next example is just a tweak of the first example; the code as shown in the book, however, does not work. However it is very close to what does work. The value of the selectManyCheckbox should be a list of CarBeans. And the rendering page should have the dataTable having a value of the same list. In the managed bean I defined such a list and in initialized it to an empty ArrayList of CarBeans. After this adjustment this example worked fine. After looking at his example code this is what his example did; it would be good however if in his book, he were to mention changing the datatype of the selectedCar property.


 

The next example is fine and is explained fine, although the names of his variables were odd. Calling a number converter "number" and calling the number that was being converted "numbery" was bizarre. I guess the author had his reasons.


 

This next example is good. It is exposing some converters in other JSF component sets – RichFaces in this case. I am looking forward to trying it out and starting to get a feel for some JSF component offerings other than the ones I am currently familiar with.

No comments: