/** * Construct an instance of the HtmlInputSecret. */ public HtmlInputSecret() { setRendererType("javax.faces.Secret"); }
/** * <p>Set the value of the <code>alt</code> property.</p> * @param alt the new property value */ public void setAlt(java.lang.String alt) { getStateHelper().put(PropertyKeys.alt, alt); handleAttribute("alt", alt); }
/** * If autocomplete is "on" or not set, do not render it */ protected boolean isAutocompleteOff(FacesContext facesContext, UIComponent component) { if (component instanceof HtmlInputSecret) { String autocomplete = ((HtmlInputSecret)component).getAutocomplete(); if (autocomplete != null) { return autocomplete.equals(AUTOCOMPLETE_VALUE_OFF); } } return false; }
private void handleAttribute(String name, Object value) { List<String> setAttributes = (List<String>) this.getAttributes().get("javax.faces.component.UIComponentBase.attributesThatAreSet"); if (setAttributes == null) { String cname = this.getClass().getName(); if (cname != null && cname.startsWith(OPTIMIZED_PACKAGE)) { setAttributes = new ArrayList<String>(6); this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes); } } if (setAttributes != null) { if (value == null) { ValueExpression ve = getValueExpression(name); if (ve == null) { setAttributes.remove(name); } } else if (!setAttributes.contains(name)) { setAttributes.add(name); } } }
/** * Gets CSS styling instructions. * * @return the new style value */ public String getStyle() { if (_style != null) { return _style; } ValueExpression expression = getValueExpression("style"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
comp.setValueExpression("maxlength", _maxlength); comp.setValueExpression("redisplay", _redisplay); comp.setValueExpression("size", _size); comp.setValueExpression("autocomplete", _autocomplete); comp.setValueExpression("accesskey", _accesskey); comp.setValueExpression("onselect", _onselect); comp.setValueExpression("onclick", _onclick); comp.setValueExpression("ondblclick", _ondblclick); comp.setValueExpression("onkeydown", _onkeydown); comp.setValueExpression("onkeypress", _onkeypress); comp.setValueExpression("onkeyup", _onkeyup); comp.setValueExpression("onmousedown", _onmousedown); comp.setValueExpression("onmousemove", _onmousemove); comp.setValueExpression("onmouseout", _onmouseout); comp.setValueExpression("onmouseover", _onmouseover);
if (uiComponent instanceof HtmlInputSecret) isRedisplay = ((HtmlInputSecret)uiComponent).isRedisplay();
/** * <p>Set the value of the <code>autocomplete</code> property.</p> * @param autocomplete the new property value */ public void setAutocomplete(java.lang.String autocomplete) { getStateHelper().put(PropertyKeys.autocomplete, autocomplete); }
comp.setValueBinding("maxlength", vb); comp.getAttributes().put("maxlength", Integer.valueOf(_maxlength)); comp.setValueBinding("redisplay", vb); comp.getAttributes().put("redisplay", Boolean.valueOf(_redisplay)); comp.setValueBinding("size", vb); comp.getAttributes().put("size", Integer.valueOf(_size)); comp.setValueBinding("style", vb); comp.getAttributes().put("style", _style); comp.setValueBinding("styleClass", vb); comp.getAttributes().put("styleClass", _styleClass); comp.setValueBinding("alt", vb); comp.getAttributes().put("alt", _alt); comp.setValueBinding("tabindex", vb); comp.getAttributes().put("tabindex", _tabindex); comp.setValueBinding("onblur", vb);
protected boolean isDisabled(FacesContext facesContext, UIComponent uiComponent) { //TODO: overwrite in extended HtmlSecretRenderer and check for enabledOnUserRole if (uiComponent instanceof HtmlInputSecret) { return ((HtmlInputSecret)uiComponent).isDisabled(); } return RendererUtils.getBooleanAttribute(uiComponent, HTML.DISABLED_ATTR, false); }
@Override public UIInput createInput() { HtmlInputSecret inputUser = new HtmlInputSecret(); LengthValidator validator = new LengthValidator(); if (getMaxLenght() != null) { inputUser.setSize(getMaxLenght()); inputUser.setMaxlength(getMaxLenght()); validator.setMaximum(getMaxLenght()); } validator.setMinimum(getMinLenght()); inputUser.addValidator(validator); return inputUser; }
protected void encodeHtmlInputSecretEnd(final FacesContext context, final HtmlInputSecret htmlInputSecret) throws IOException { final ResponseWriter writer = context.getResponseWriter(); writer.startElement(JsfConstants.INPUT_ELEM, htmlInputSecret); RendererUtil.renderAttribute(writer, JsfConstants.TYPE_ATTR, JsfConstants.PASSWORD_VALUE); RendererUtil.renderIdAttributeIfNecessary(writer, htmlInputSecret, getIdForRender(context, htmlInputSecret)); RendererUtil.renderAttribute(writer, JsfConstants.NAME_ATTR, htmlInputSecret.getClientId(context)); String value = ValueHolderUtil.getValueForRender(context, htmlInputSecret); if (!htmlInputSecret.isRedisplay()) { value = ""; } RendererUtil.renderAttribute(writer, JsfConstants.VALUE_ATTR, HTMLEncodeUtil.encode(value, true, true)); renderStyleClass(context, htmlInputSecret, writer); renderRemainAttributes(htmlInputSecret, writer, ignoreAttribute); writer.endElement(JsfConstants.INPUT_ELEM); }
private void handleAttribute(String name, Object value) { List<String> setAttributes = (List<String>) this.getAttributes().get("javax.faces.component.UIComponentBase.attributesThatAreSet"); if (setAttributes == null) { String cname = this.getClass().getName(); if (cname != null && cname.startsWith(OPTIMIZED_PACKAGE)) { setAttributes = new ArrayList<String>(6); this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes); } } if (setAttributes != null) { if (value == null) { ValueExpression ve = getValueExpression(name); if (ve == null) { setAttributes.remove(name); } } else if (!setAttributes.contains(name)) { setAttributes.add(name); } } }
/** * Gets Script to be invoked when the element is clicked. * * @return the new onclick value */ public String getOnclick() { if (_onclick != null) { return _onclick; } ValueExpression expression = getValueExpression("onclick"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
comp.setValueExpression("maxlength", _maxlength); comp.setValueExpression("redisplay", _redisplay); comp.setValueExpression("size", _size); comp.setValueExpression("autocomplete", _autocomplete); comp.setValueExpression("label", _label); comp.setValueExpression("style", _style); comp.setValueExpression("styleClass", _styleClass); comp.setValueExpression("alt", _alt); comp.setValueExpression("tabindex", _tabindex); comp.setValueExpression("onblur", _onblur); comp.setValueExpression("onfocus", _onfocus); comp.setValueExpression("accesskey", _accesskey); comp.setValueExpression("onchange", _onchange); comp.setValueExpression("onselect", _onselect); comp.setValueExpression("onclick", _onclick);
if (uiComponent instanceof HtmlInputSecret) isRedisplay = ((HtmlInputSecret)uiComponent).isRedisplay();
/** * <p>Set the value of the <code>disabled</code> property.</p> * @param disabled the new property value */ public void setDisabled(boolean disabled) { getStateHelper().put(PropertyKeys.disabled, disabled); }
protected boolean isDisabled(FacesContext facesContext, UIComponent uiComponent) { //TODO: overwrite in extended HtmlSecretRenderer and check for enabledOnUserRole if (uiComponent instanceof HtmlInputSecret) { return ((HtmlInputSecret)uiComponent).isDisabled(); } else { return RendererUtils.getBooleanAttribute(uiComponent, HTML.DISABLED_ATTR, false); } }
/** * <p>Set the value of the <code>lang</code> property.</p> * @param lang the new property value */ public void setLang(java.lang.String lang) { getStateHelper().put(PropertyKeys.lang, lang); handleAttribute("lang", lang); }
private void handleAttribute(String name, Object value) { List<String> setAttributes = (List<String>) this.getAttributes().get("javax.faces.component.UIComponentBase.attributesThatAreSet"); if (setAttributes == null) { String cname = this.getClass().getName(); if (cname != null && cname.startsWith(OPTIMIZED_PACKAGE)) { setAttributes = new ArrayList<String>(6); this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes); } } if (setAttributes != null) { if (value == null) { ValueExpression ve = getValueExpression(name); if (ve == null) { setAttributes.remove(name); } } else if (!setAttributes.contains(name)) { setAttributes.add(name); } } }