/** * Construct an instance of the HtmlSelectManyListbox. */ public HtmlSelectManyListbox() { setRendererType("javax.faces.Listbox"); }
/** * <p>Set the value of the <code>onkeydown</code> property.</p> * @param onkeydown the new property value */ public void setOnkeydown(java.lang.String onkeydown) { getStateHelper().put(PropertyKeys.onkeydown, onkeydown); handleAttribute("onkeydown", onkeydown); }
/** * Gets Script to be invoked when the element is double-clicked. * * @return the new ondblclick value */ public String getOndblclick() { if (_ondblclick != null) { return _ondblclick; } ValueExpression expression = getValueExpression("ondblclick"); 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);
public void validate(FacesContext context) { Object submittedValue = getSubmittedValue(); if ("".equals(submittedValue)) { submittedValue = new String[0]; if (!isValid()) { return; if (isRequired() && empty) { context.addMessage(getClientId(context), FacesMessageUtil .getMessage(context, REQUIRED_MESSAGE_ID, new Object[] { getLabel() })); setValid(false); return; validateForExtension(context, convertedValue); if (!isValid()) { return; if (isDisabled()) { return; Object previousValue = getValue(); setValue(convertedValue); setSubmittedValue(null); if (compareValues(previousValue, convertedValue)) { queueEvent(new ValueChangeEvent(this, previousValue, convertedValue));
/** * <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); }
/** * <p>Return the value of the <code>disabled</code> property.</p> */ public boolean isDisabled() { if (!Util.isEnabledOnUserRole(this)) { return true; } else { return super.isDisabled(); } }
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);
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 Script to be invoked when the pointing device is pressed over this element. * * @return the new onmousedown value */ public String getOnmousedown() { if (_onmousedown != null) { return _onmousedown; } ValueExpression expression = getValueExpression("onmousedown"); 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.addValueChangeListener(new MethodExpressionValueChangeListener(_valueChangeListener)); comp.setValueExpression("disabledClass", _disabledClass); comp.setValueExpression("title", _title); comp.setValueExpression("dir", _dir); comp.setValueExpression("immediate", _immediate); comp.setValueExpression("onkeypress", _onkeypress); comp.setValueExpression("onmouseover", _onmouseover); comp.setValueExpression("lang", _lang); comp.setValueExpression("onmousedown", _onmousedown); comp.addValidator(new MethodExpressionValidator(_validator)); comp.setValueExpression("onmouseout", _onmouseout); comp.setValueExpression("label", _label); comp.setValueExpression("readonly", _readonly); comp.setValueExpression("onchange", _onchange);
/** * <p>Return the value of the <code>onblur</code> property.</p> * @return the property value * <p>Contents: Javascript code executed when this element loses focus. */ public java.lang.String getOnblur() { return (java.lang.String) getStateHelper().eval(PropertyKeys.onblur); }
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 RendererUtils.getBooleanAttribute(uiComponent, 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>onkeypress</code> property.</p> * @param onkeypress the new property value */ public void setOnkeypress(java.lang.String onkeypress) { getStateHelper().put(PropertyKeys.onkeypress, onkeypress); handleAttribute("onkeypress", onkeypress); }
/** * Gets A diplay name for this component. * * @return the new label value */ public String getLabel() { if (_label != null) { return _label; } ValueExpression expression = getValueExpression("label"); 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); } } }
public HtmlSelectManyListbox() { super(); setRendererType("javax.faces.Listbox"); }