SelectMany return list of POJO : improve MenuRenderer ?
I can't figure out why MenuRenderer doesn't use the converter when the model type is a List.
protected ArrayList<String> handleListCase(FacesContext context,
String[] newValues){
int i = 0, len = newValues.length;
ArrayList<String> result =new ArrayList<String>(len);
for (i = 0; i < len; i++){
result.add(newValues[i]);
}
return result;
}
It just convert a String array into a String list (BTW why don't you use Arrays.asList( newValues ) ?).
My suggestion is to use the handleArrayCase method and then convert it into a List.
handleListCase would become :
protected List handleListCase(FacesContext context,
UISelectMany uiSelectMany,
String[] newValues){
return Arrays.asList( (Object[])handleArrayCase(context, uiSelectMany, Object[].class, newValues) );
}
This simple hack would enable us to use all the selectMany tags with List.

