public HtmlSelectManyCheckbox() { super(); setRendererType("javax.faces.Checkbox"); }
/** * <p>Set the value of the <code>border</code> property.</p> * @param border the new property value */ public void setBorder(int border) { getStateHelper().put(PropertyKeys.border, border); handleAttribute("border", border); }
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 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; }
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));
comp.setValueExpression("border", _border); comp.setValueExpression("layout", _layout); comp.setValueExpression("selectedClass", _selectedClass); comp.setValueExpression("unselectedClass", _unselectedClass); 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);
/** * <p>Return the value of the <code>enabledClass</code> property.</p> * @return the property value * <p>Contents: CSS style class to apply to the rendered label * on enabled options. */ public java.lang.String getEnabledClass() { return (java.lang.String) getStateHelper().eval(PropertyKeys.enabledClass); }
/** * <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("border", vb); comp.getAttributes().put("border", Integer.valueOf(_border)); comp.setValueBinding("layout", vb); comp.getAttributes().put("layout", _layout); 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);
protected String getLayout(UISelectMany selectMany) { if (selectMany instanceof HtmlSelectManyCheckbox) { return ((HtmlSelectManyCheckbox) selectMany).getLayout(); } return (String) selectMany.getAttributes().get(JSFAttr.LAYOUT_ATTR); }
protected boolean isDisabled(FacesContext facesContext, UIComponent component) { //TODO: overwrite in extended HtmlCheckboxRenderer and check for // enabledOnUserRole boolean disabled; boolean readonly; if (component instanceof HtmlSelectBooleanCheckbox) { disabled = ((HtmlSelectBooleanCheckbox) component).isDisabled(); readonly = ((HtmlSelectBooleanCheckbox) component).isReadonly(); } else if (component instanceof HtmlSelectManyCheckbox) { disabled = ((HtmlSelectManyCheckbox) component).isDisabled(); readonly = ((HtmlSelectManyCheckbox) component).isReadonly(); } else { disabled = RendererUtils.getBooleanAttribute(component, HTML.DISABLED_ATTR, false); readonly = RendererUtils.getBooleanAttribute(component, HTML.READONLY_ATTR, false); } if (!disabled && readonly) { disabled = MyfacesConfig.getCurrentInstance(facesContext .getExternalContext()).isReadonlyAsDisabledForSelect(); } return disabled; }
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 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; }
comp.setValueExpression("border", _border); comp.setValueExpression("layout", _layout); comp.setValueExpression("selectedClass", _selectedClass); comp.setValueExpression("unselectedClass", _unselectedClass); 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);
/** * <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 component) { //TODO: overwrite in extended HtmlCheckboxRenderer and check for // enabledOnUserRole if (component instanceof HtmlSelectBooleanCheckbox) { return ((HtmlSelectBooleanCheckbox) component).isDisabled(); } else if (component instanceof HtmlSelectManyCheckbox) { return ((HtmlSelectManyCheckbox) component).isDisabled(); } else { return org.apache.myfaces.shared_impl.renderkit.RendererUtils.getBooleanAttribute(component, HTML.DISABLED_ATTR, false); } }
protected String getLayout(UISelectMany selectMany) { if (selectMany instanceof HtmlSelectManyCheckbox) { return ((HtmlSelectManyCheckbox) selectMany).getLayout(); } return (String) selectMany.getAttributes().get(JSFAttr.LAYOUT_ATTR); }
protected boolean isDisabled(FacesContext facesContext, UIComponent component) { //TODO: overwrite in extended HtmlCheckboxRenderer and check for // enabledOnUserRole boolean disabled; boolean readonly; if (component instanceof HtmlSelectBooleanCheckbox) { disabled = ((HtmlSelectBooleanCheckbox) component).isDisabled(); readonly = ((HtmlSelectBooleanCheckbox) component).isReadonly(); } else if (component instanceof HtmlSelectManyCheckbox) { disabled = ((HtmlSelectManyCheckbox) component).isDisabled(); readonly = ((HtmlSelectManyCheckbox) component).isReadonly(); } else { disabled = RendererUtils.getBooleanAttribute(component, HTML.DISABLED_ATTR, false); readonly = RendererUtils.getBooleanAttribute(component, HTML.READONLY_ATTR, false); } if (!disabled && readonly) { disabled = MyfacesConfig.getCurrentInstance(facesContext .getExternalContext()).isReadonlyAsDisabledForSelect(); } return disabled; }
/** * <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); } } }