@Override public void decode(FacesContext context, UIComponent component) { UISelectMany selectMany = (UISelectMany) component; if (!shouldDecode(selectMany)) { return; } String submitParam = getSubmitParam(context, selectMany); Map<String, String[]> params = context.getExternalContext().getRequestParameterValuesMap(); String[] submittedValues = params.containsKey(submitParam) ? params.get(submitParam) : new String[0]; submittedValues = validateSubmittedValues(context, selectMany, (Object[]) getValues(selectMany), submittedValues); selectMany.setSubmittedValue(submittedValues); decodeBehaviors(context, selectMany); }
@Override public void decode(FacesContext context, UIComponent component) { if (!shouldDecode(component)) { return; } UISelectMany selectMany = (UISelectMany) component; decodeBehaviors(context, selectMany); String submitParam = getSubmitParam(context, selectMany); Map<String, String[]> params = context.getExternalContext().getRequestParameterValuesMap(); if (params.containsKey(submitParam)) { selectMany.setSubmittedValue(params.get(submitParam)); } else { selectMany.setSubmittedValue(new String[0]); } }
@Override public void decode(final FacesContext facesContext, final UIComponent component) { if (ComponentUtils.isOutputOnly(component)) { return; } final UISelectMany select = (UISelectMany) component; String[] newValues = facesContext.getExternalContext().getRequestParameterValuesMap().get(select.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 (final String newValue : newValues) { LOG.debug("newValues[i] = '" + newValue + "'"); } } } if (newValues == null) { newValues = ArrayUtils.EMPTY_STRING_ARRAY; // because no selection will not submitted by browsers } select.setSubmittedValue(newValues); RenderUtils.decodeClientBehaviors(facesContext, select); }