protected void encodeMarkup(FacesContext context, AutoComplete ac) throws IOException { if (ac.isMultiple()) { encodeMultipleMarkup(context, ac); } else { encodeSingleMarkup(context, ac); } }
@Override public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException { AutoComplete ac = (AutoComplete) component; if (submittedValue == null || submittedValue.equals("") || ac.isMoreTextRequest(context)) { return null; } Converter converter = ComponentUtils.getConverter(context, component); if (ac.isMultiple()) { String[] values = (String[]) submittedValue; List list = new ArrayList(); for (String value : values) { if (isValueBlank(value)) { continue; } Object convertedValue = converter != null ? converter.getAsObject(context, ac, value) : value; if (convertedValue != null) { list.add(convertedValue); } } return list; } else { if (converter != null) { return converter.getAsObject(context, component, (String) submittedValue); } else { return submittedValue; } } }
@Override public void decode(FacesContext context, UIComponent component) { AutoComplete ac = (AutoComplete) component; String clientId = ac.getClientId(context); Map<String, String> params = context.getExternalContext().getRequestParameterMap(); if (!shouldDecode(ac)) { return; } if (ac.isMultiple()) { decodeMultiple(context, ac); } else { decodeSingle(context, ac); } decodeBehaviors(context, ac); // AutoComplete event String query = params.get(clientId + "_query"); if (query != null) { AutoCompleteEvent autoCompleteEvent = new AutoCompleteEvent(ac, query); autoCompleteEvent.setPhaseId(PhaseId.APPLY_REQUEST_VALUES); ac.queueEvent(autoCompleteEvent); } }
.attr("forceSelection", ac.isForceSelection(), false) .attr("scrollHeight", ac.getScrollHeight(), Integer.MAX_VALUE) .attr("multiple", ac.isMultiple(), false) .attr("appendTo", SearchExpressionFacade.resolveClientId(context, ac, ac.getAppendTo()), null) .attr("grouping", ac.getValueExpression(AutoComplete.PropertyKeys.groupBy.toString()) != null, false) if (ac.isMultiple()) { wb.attr("selectLimit", ac.getSelectLimit(), Integer.MAX_VALUE);
protected void encodeMarkup(FacesContext context, AutoComplete ac) throws IOException { if (ac.isMultiple()) { encodeMultipleMarkup(context, ac); } else { encodeSingleMarkup(context, ac); } }
@Override public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException { AutoComplete ac = (AutoComplete) component; if (submittedValue == null || submittedValue.equals("") || ac.isMoreTextRequest(context)) { return null; } Converter converter = ComponentUtils.getConverter(context, component); if (ac.isMultiple()) { String[] values = (String[]) submittedValue; List list = new ArrayList(); for (String value : values) { if (isValueBlank(value)) { continue; } Object convertedValue = converter != null ? converter.getAsObject(context, ac, value) : value; if (convertedValue != null) { list.add(convertedValue); } } return list; } else { if (converter != null) { return converter.getAsObject(context, component, (String) submittedValue); } else { return submittedValue; } } }
@Override public void decode(FacesContext context, UIComponent component) { AutoComplete ac = (AutoComplete) component; String clientId = ac.getClientId(context); Map<String, String> params = context.getExternalContext().getRequestParameterMap(); if (ac.isDisabled() || ac.isReadonly()) { return; } if (ac.isMultiple()) { decodeMultiple(context, ac); } else { decodeSingle(context, ac); } decodeBehaviors(context, ac); // AutoComplete event String query = params.get(clientId + "_query"); if (query != null) { AutoCompleteEvent autoCompleteEvent = new AutoCompleteEvent(ac, query); autoCompleteEvent.setPhaseId(PhaseId.APPLY_REQUEST_VALUES); ac.queueEvent(autoCompleteEvent); } }
.attr("forceSelection", ac.isForceSelection(), false) .attr("scrollHeight", ac.getScrollHeight(), Integer.MAX_VALUE) .attr("multiple", ac.isMultiple(), false) .attr("appendTo", SearchExpressionFacade.resolveClientId(context, ac, ac.getAppendTo()), null) .attr("grouping", ac.getValueExpression(AutoComplete.PropertyKeys.groupBy.toString()) != null, false) if (ac.isMultiple()) { wb.attr("selectLimit", ac.getSelectLimit(), Integer.MAX_VALUE);