protected void encodeHiddenSelect(FacesContext context, AutoComplete ac, String clientId, List<String> values) throws IOException { ResponseWriter writer = context.getResponseWriter(); String id = clientId + "_hinput"; writer.startElement("select", null); writer.writeAttribute("id", id, null); writer.writeAttribute("name", id, null); writer.writeAttribute("multiple", "multiple", null); writer.writeAttribute("class", "ui-helper-hidden-accessible", null); writer.writeAttribute("tabindex", "-1", null); if (ac.isDisabled()) { writer.writeAttribute("disabled", "disabled", "disabled"); } renderValidationMetadata(context, ac); for (int i = 0; i < values.size(); i++) { String value = values.get(i); writer.startElement("option", null); writer.writeAttribute("value", value, null); writer.writeAttribute("selected", "selected", null); writer.endElement("option"); } writer.endElement("select"); }
protected void encodeInput(FacesContext context, AutoComplete ac, String clientId) throws IOException { ResponseWriter writer = context.getResponseWriter(); boolean disabled = ac.isDisabled(); String var = ac.getVar(); String itemLabel;
protected void encodeDropDown(FacesContext context, AutoComplete ac) throws IOException { ResponseWriter writer = context.getResponseWriter(); String dropdownClass = AutoComplete.DROPDOWN_CLASS; boolean disabled = ac.isDisabled() || ac.isReadonly(); if (disabled) { dropdownClass += " ui-state-disabled"; } writer.startElement("button", ac); writer.writeAttribute("class", dropdownClass, null); writer.writeAttribute("type", "button", null); if (disabled) { writer.writeAttribute("disabled", "disabled", null); } if (ac.getTabindex() != null) { writer.writeAttribute("tabindex", ac.getTabindex(), null); } writer.startElement("span", null); writer.writeAttribute("class", "ui-button-icon-primary ui-icon ui-icon-triangle-1-s", null); writer.endElement("span"); writer.startElement("span", null); writer.writeAttribute("class", "ui-button-text", null); writer.write(" "); writer.endElement("span"); writer.endElement("button"); }
boolean disabled = ac.isDisabled(); String title = ac.getTitle();
@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); } }
if (ac.isDisabled()) { writer.writeAttribute("disabled", "disabled", null);
protected void encodeInput(FacesContext context, AutoComplete ac, String clientId) throws IOException { ResponseWriter writer = context.getResponseWriter(); boolean disabled = ac.isDisabled(); String var = ac.getVar(); String itemLabel;
protected void encodeDropDown(FacesContext context, AutoComplete ac) throws IOException { ResponseWriter writer = context.getResponseWriter(); String dropdownClass = AutoComplete.DROPDOWN_CLASS; boolean disabled = ac.isDisabled() || ac.isReadonly(); if (disabled) { dropdownClass += " ui-state-disabled"; } writer.startElement("button", ac); writer.writeAttribute("class", dropdownClass, null); writer.writeAttribute("type", "button", null); if (disabled) { writer.writeAttribute("disabled", "disabled", null); } if (ac.getTabindex() != null) { writer.writeAttribute("tabindex", ac.getTabindex(), null); } writer.startElement("span", null); writer.writeAttribute("class", "ui-button-icon-primary ui-icon ui-icon-triangle-1-s", null); writer.endElement("span"); writer.startElement("span", null); writer.writeAttribute("class", "ui-button-text", null); writer.write(" "); writer.endElement("span"); writer.endElement("button"); }
protected void encodeHiddenSelect(FacesContext context, AutoComplete ac, String clientId, List<String> values) throws IOException { ResponseWriter writer = context.getResponseWriter(); String id = clientId + "_hinput"; writer.startElement("select", null); writer.writeAttribute("id", id, null); writer.writeAttribute("name", id, null); writer.writeAttribute("multiple", "multiple", null); writer.writeAttribute("class", "ui-helper-hidden-accessible", null); if (ac.isDisabled()) { writer.writeAttribute("disabled", "disabled", "disabled"); } for (String value : values) { writer.startElement("option", null); writer.writeAttribute("value", value, null); writer.writeAttribute("selected", "selected", null); writer.endElement("option"); } if (RequestContext.getCurrentInstance().getApplicationContext().getConfig().isClientSideValidationEnabled()) { renderValidationMetadata(context, ac); } writer.endElement("select"); }
boolean disabled = ac.isDisabled(); String title = ac.getTitle();