requestMap.put(var, varObject);
}
}
protected void encodeItems(FacesContext facesContext, UIComponent component, List<Object> fetchValues) throws IOException {
AbstractAutocomplete comboBox = (AbstractAutocomplete) component;
AutocompleteEncodeStrategy strategy = getStrategy(component);
strategy.encodeItemsContainerBegin(facesContext, component);
Object savedVar = saveVar(facesContext, comboBox.getVar());
Map<String, String> requestParameters = facesContext.getExternalContext().getRequestParameterMap();
String value = requestParameters.get(component.getClientId(facesContext) + "Value");
Iterator<Object> itemsIterator = comboBox.getItems(facesContext, value).iterator();
if (!itemsIterator.hasNext()) {
strategy.encodeFakeItem(facesContext, component);
} else {
while (itemsIterator.hasNext()) {
Object item = itemsIterator.next();
setVar(facesContext, comboBox.getVar(), item);
this.encodeItem(facesContext, comboBox, item, strategy);
if (comboBox.getFetchValue() != null) {
fetchValues.add(comboBox.getFetchValue().toString());
} else if (item != null) {
fetchValues.add(item.toString());
}
}
}
setVar(facesContext, comboBox.getVar(), savedVar);
strategy.encodeItemsContainerEnd(facesContext, component);
}