public void decode(FacesContext facesContext, UIComponent component) {
if (ComponentUtils.isOutputOnly(component)) {
return;
}
if (component instanceof UISelectMany) {
UISelectMany uiSelectMany = (UISelectMany) component;
String[] newValues = (String[])
facesContext.getExternalContext().getRequestParameterValuesMap().get(uiSelectMany.getClientId(facesContext));
if (LOG.isDebugEnabled()) {
LOG.debug("decode: key='" + component.getClientId(facesContext)
+ "' value='" + Arrays.toString(newValues) + "'");
LOG.debug("size ... '" + (newValues != null ? newValues.length : -1) + "'");
if (newValues != null) {
for (String newValue : newValues) {
LOG.debug("newValues[i] = '" + newValue + "'");
}
}
}
if (newValues == null) {
newValues = ArrayUtils.EMPTY_STRING_ARRAY; // because no selection will not submitted by browsers
}
uiSelectMany.setSubmittedValue(newValues);
}
}