protected void encodeMarkup(FacesContext context, AutoComplete ac) throws IOException { if (ac.isMultiple()) { encodeMultipleMarkup(context, ac); } else { encodeSingleMarkup(context, ac); } }
@Override public String getValidatableInputClientId() { return getInputClientId(); }
@Override public String getInputClientId() { return getClientId(getFacesContext()) + "_input"; }
@SuppressWarnings("unchecked") public void encodeResults(FacesContext context, UIComponent component, String query) throws IOException { AutoComplete ac = (AutoComplete) component; List results = ac.getSuggestions(); int maxResults = ac.getMaxResults(); if (maxResults != Integer.MAX_VALUE && results != null && results.size() > maxResults) { results = results.subList(0, ac.getMaxResults()); } encodeSuggestions(context, ac, results); }
protected void encodeSuggestions(FacesContext context, AutoComplete ac, List items) throws IOException { boolean customContent = !ac.getColums().isEmpty(); Converter converter = ComponentUtils.getConverter(context, ac); if (customContent) { encodeSuggestionsAsTable(context, ac, items, converter); } else { encodeSuggestionsAsList(context, ac, items, converter); } }
public void setPlaceholder(String placeholder) { getStateHelper().put(PropertyKeys.placeholder, placeholder); }
public AutoCompleteBase() { setRendererType(DEFAULT_RENDERER); }
@Override public String resolveWidgetVar() { return ComponentUtils.resolveWidgetVar(getFacesContext(), this); } }
@Override public void setLabelledBy(String labelledBy) { getStateHelper().put("labelledby", labelledBy); } }
public int getQueryDelay() { return (Integer) getStateHelper().eval(PropertyKeys.queryDelay, 300); }
public boolean isForceSelection() { return (Boolean) getStateHelper().eval(PropertyKeys.forceSelection, false); }
public void setPanelStyle(String panelStyle) { getStateHelper().put(PropertyKeys.panelStyle, panelStyle); }
public void setPanelStyleClass(String panelStyleClass) { getStateHelper().put(PropertyKeys.panelStyleClass, panelStyleClass); }
public void setCache(boolean cache) { getStateHelper().put(PropertyKeys.cache, cache); }
public String getAppendTo() { return (String) getStateHelper().eval(PropertyKeys.appendTo, "@(body)"); }
public void setQueryEvent(String queryEvent) { getStateHelper().put(PropertyKeys.queryEvent, queryEvent); }
public boolean isAutoHighlight() { return (Boolean) getStateHelper().eval(PropertyKeys.autoHighlight, true); }
public String getInputStyle() { return (String) getStateHelper().eval(PropertyKeys.inputStyle, null); }
public void setInputStyleClass(String inputStyleClass) { getStateHelper().put(PropertyKeys.inputStyleClass, inputStyleClass); }
public String getType() { return (String) getStateHelper().eval(PropertyKeys.type, "text"); }