public HtmlSelectOneListbox() { super(); setRendererType("javax.faces.Listbox"); }
/** * <p>Set the value of the <code>title</code> property.</p> * @param title the new property value */ public void setTitle(java.lang.String title) { getStateHelper().put(PropertyKeys.title, title); handleAttribute("title", title); }
/** * Gets The base language of this document. * * @return the new lang value */ public String getLang() { if (_lang != null) { return _lang; } ValueExpression expression = getValueExpression("lang"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
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); } } }
comp.setValueExpression("size", _size); comp.setValueExpression("accesskey", _accesskey); comp.setValueExpression("disabled", _disabled); comp.setValueExpression("readonly", _readonly); 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); comp.setValueExpression("onmouseup", _onmouseup); comp.setValueExpression("style", _style);
/** * <p>Return the value of the <code>dir</code> property.</p> * @return the property value * <p>Contents: Direction indication for text that does not inherit directionality. * Valid values are "LTR" (left-to-right) and "RTL" (right-to-left). * These attributes are case sensitive when rendering to XHTML, so * care must be taken to have the correct case. */ public java.lang.String getDir() { return (java.lang.String) getStateHelper().eval(PropertyKeys.dir); }
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("tabindex", vb); comp.getAttributes().put("tabindex", _tabindex); comp.setValueBinding("onblur", vb); comp.getAttributes().put("onblur", _onblur); comp.setValueBinding("onfocus", vb); comp.getAttributes().put("onfocus", _onfocus); comp.setValueBinding("disabledClass", vb); comp.getAttributes().put("disabledClass", _disabledClass); comp.setValueBinding("enabledClass", vb);
/** * <p>Return the value of the <code>disabled</code> property.</p> */ public boolean isDisabled() { if (!Util.isEnabledOnUserRole(this)) { return true; } else { return super.isDisabled(); } }
protected boolean isDisabled(FacesContext facesContext, UIComponent uiComponent) { //TODO: overwrite in extended HtmlListboxRenderer and check for enabledOnUserRole boolean disabled; boolean readonly; if (uiComponent instanceof HtmlSelectManyListbox) { disabled = ((HtmlSelectManyListbox)uiComponent).isDisabled(); readonly = ((HtmlSelectManyListbox)uiComponent).isReadonly(); } else if (uiComponent instanceof HtmlSelectOneListbox) { disabled = ((HtmlSelectOneListbox)uiComponent).isDisabled(); readonly = ((HtmlSelectOneListbox)uiComponent).isReadonly(); } else { disabled = RendererUtils.getBooleanAttribute(uiComponent, HTML.DISABLED_ATTR, false); readonly = RendererUtils.getBooleanAttribute(uiComponent, HTML.READONLY_ATTR, false); } if (!disabled && readonly) { disabled = MyfacesConfig.getCurrentInstance(facesContext .getExternalContext()).isReadonlyAsDisabledForSelect(); } return disabled; }
/** * Gets An advisory title for this element. Often used by the user agent as a tooltip. * * @return the new title value */ public String getTitle() { if (_title != null) { return _title; } ValueExpression expression = getValueExpression("title"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
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); } } }
comp.setValueExpression("enabledClass", _enabledClass); comp.addValueChangeListener(new MethodExpressionValueChangeListener(_valueChangeListener)); comp.setValueExpression("readonly", _readonly); comp.setValueExpression("immediate", _immediate); comp.setValueExpression("styleClass", _styleClass); comp.setValueExpression("onselect", _onselect); comp.setValueExpression("disabledClass", _disabledClass); comp.setValueExpression("onkeydown", _onkeydown); comp.setValueExpression("label", _label); comp.addValidator(new MethodExpressionValidator(_validator)); comp.setValueExpression("onmouseup", _onmouseup); comp.setValueExpression("lang", _lang); comp.setValueExpression("required", _required); comp.setValueExpression("onkeypress", _onkeypress); comp.setValueExpression("accesskey", _accesskey);
/** * <p>Set the value of the <code>enabledClass</code> property.</p> * @param enabledClass the new property value */ public void setEnabledClass(java.lang.String enabledClass) { getStateHelper().put(PropertyKeys.enabledClass, enabledClass); }
protected boolean isDisabled(FacesContext facesContext, UIComponent uiComponent) { //TODO: overwrite in extended HtmlListboxRenderer and check for enabledOnUserRole if (uiComponent instanceof HtmlSelectManyListbox) { return ((HtmlSelectManyListbox)uiComponent).isDisabled(); } else if (uiComponent instanceof HtmlSelectOneListbox) { return ((HtmlSelectOneListbox)uiComponent).isDisabled(); } else { return org.apache.myfaces.shared_impl.renderkit.RendererUtils.getBooleanAttribute(uiComponent, org.apache.myfaces.shared_impl.renderkit.html.HTML.DISABLED_ATTR, false); } }
protected boolean isDisabled(FacesContext facesContext, UIComponent uiComponent) { //TODO: overwrite in extended HtmlListboxRenderer and check for enabledOnUserRole boolean disabled; boolean readonly; if (uiComponent instanceof HtmlSelectManyListbox) { disabled = ((HtmlSelectManyListbox)uiComponent).isDisabled(); readonly = ((HtmlSelectManyListbox)uiComponent).isReadonly(); } else if (uiComponent instanceof HtmlSelectOneListbox) { disabled = ((HtmlSelectOneListbox)uiComponent).isDisabled(); readonly = ((HtmlSelectOneListbox)uiComponent).isReadonly(); } else { disabled = RendererUtils.getBooleanAttribute(uiComponent, HTML.DISABLED_ATTR, false); readonly = RendererUtils.getBooleanAttribute(uiComponent, HTML.READONLY_ATTR, false); } if (!disabled && readonly) { disabled = MyfacesConfig.getCurrentInstance(facesContext .getExternalContext()).isReadonlyAsDisabledForSelect(); } return disabled; }
/** * <p>Set the value of the <code>ondblclick</code> property.</p> * @param ondblclick the new property value */ public void setOndblclick(java.lang.String ondblclick) { getStateHelper().put(PropertyKeys.ondblclick, ondblclick); handleAttribute("ondblclick", ondblclick); }
/** * Gets When true, this element cannot receive focus. * * @return the new disabled value */ public boolean isDisabled() { if (_disabledSet) { return _disabled; } ValueExpression expression = getValueExpression("disabled"); if (expression != null) { return (Boolean)expression.getValue(getFacesContext().getELContext()); } 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); } } }
/** * Construct an instance of the HtmlSelectOneListbox. */ public HtmlSelectOneListbox() { setRendererType("javax.faces.Listbox"); }
comp.setValueExpression("size", _size); comp.setValueExpression("label", _label); comp.setValueExpression("style", _style); comp.setValueExpression("styleClass", _styleClass); comp.setValueExpression("tabindex", _tabindex); comp.setValueExpression("onblur", _onblur); comp.setValueExpression("onfocus", _onfocus); comp.setValueExpression("disabledClass", _disabledClass); comp.setValueExpression("enabledClass", _enabledClass); comp.setValueExpression("accesskey", _accesskey); comp.setValueExpression("onclick", _onclick); comp.setValueExpression("ondblclick", _ondblclick); comp.setValueExpression("onkeydown", _onkeydown); comp.setValueExpression("onkeypress", _onkeypress); comp.setValueExpression("onkeyup", _onkeyup);