-
1. Re: pickList error: value of UIPickList component is not of type Array or List
ilya_shaikovsky Jun 8, 2010 2:48 AM (in response to hbender)1) selectItems tag should be pointed to list of selectItem objects. Or you should provide the converter for your Permission object.
2) the same for value attribute.
check please http://community.jboss.org/message/521331#521331 and related issue also for more info.
-
2. Re: pickList error: value of UIPickList component is not of type Array or List
hbender Jun 8, 2010 9:33 AM (in response to ilya_shaikovsky)tks Ilya for clarification.
Meanwhile I found - by stepping through the code and try'n'error - nearly the same result.
The selectItems must indeed be provided by a List<SelectItem>. But if the value is also populated by such a list, the PickListRenderer.selectItemsForSelectedList() would not evalutate to equal:
if (lookupItem.equals(selectItem.getValue())) {
selectItemForSelectedValues.add(selectItem);
}(the lookupItem is taken from the values list, here an SelectItem, and compared against the selectItem.getValue(), which is my embedded class -> never equals).
Therefore the values have to be populated by the payload class, and a Converter has to be provided.
It would be nice if this method would behave correctly if the value list also contains SelecItem instances. Something like:
Object lookup = ( lookupItem instanceof SelectItem ? lookupItem.getValue() : lookupItem );
if (lookup.equals(selectItem.getValue())) {
selectItemForSelectedValues.add(selectItem);
}BTW: My original collections are of type set. Therefore I have to transform them to a list. Is there a inherent reason why the pickList does not support all types of Collection as value parameter?
And if there is a good reason: The reference (http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_pickList.html) and the java doc (http://docs.jboss.org/richfaces/latest_3_3_X/en/tlddoc/index.html) should state this fact clearly.
Heri