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.

[1366 byte] By [brunobietha] at [2007-11-27 5:55:21]
# 1
Is there a JIRA for Sun JSF Impl where I could suggest this ?
brunobietha at 2007-7-12 16:23:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...