public HtmlSelectOneRadio() { super(); setRendererType("javax.faces.Radio"); }
/** * <p>Set the value of the <code>accesskey</code> property.</p> * @param accesskey the new property value */ public void setAccesskey(java.lang.String accesskey) { getStateHelper().put(PropertyKeys.accesskey, accesskey); handleAttribute("accesskey", accesskey); }
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 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; }
comp.setValueExpression("border", _border); comp.setValueExpression("layout", _layout); comp.setValueExpression("group", _group); comp.setValueExpression("accesskey", _accesskey); comp.setValueExpression("onselect", _onselect); 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.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 boolean isDisabled(FacesContext facesContext, UIComponent uiComponent) { //TODO: overwrite in extended HtmlRadioRenderer and check for enabledOnUserRole if (uiComponent instanceof HtmlSelectOneRadio) { return ((HtmlSelectOneRadio)uiComponent).isDisabled(); } return RendererUtils.getBooleanAttribute(uiComponent, HTML.DISABLED_ATTR, false); }
protected String getLayout(UIComponent selectOne) { if (selectOne instanceof HtmlSelectOneRadio) { return ((HtmlSelectOneRadio)selectOne).getLayout(); } return (String)selectOne.getAttributes().get(JSFAttr.LAYOUT_ATTR); }
protected String getStyleClass(UISelectOne selectOne) { if (selectOne instanceof HtmlSelectOneRadio) { return ((HtmlSelectOneRadio)selectOne).getStyleClass(); } return (String)selectOne.getAttributes().get(JSFAttr.STYLE_CLASS_ATTR); }
/** * <p>Return the value of the <code>border</code> property.</p> * @return the property value * <p>Contents: Width (in pixels) of the border to be drawn * around the table containing the options list. * This attribute is ignored when "group" attribute is specified. */ public int getBorder() { return (java.lang.Integer) getStateHelper().eval(PropertyKeys.border, Integer.MIN_VALUE); }
protected boolean isDisabled(FacesContext facesContext, UIComponent uiComponent) { //TODO: overwrite in extended HtmlRadioRenderer and check for enabledOnUserRole boolean disabled; boolean readonly; if (uiComponent instanceof HtmlSelectOneRadio) { disabled = ((HtmlSelectOneRadio) uiComponent).isDisabled(); readonly = ((HtmlSelectOneRadio) 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; }
public void encodeBegin(final FacesContext context, final UIComponent component) throws IOException { assertNotNull(context, component); if (!component.isRendered()) { return; } final THtmlRadioItem htmlInputRadio = (THtmlRadioItem) component; final String name = htmlInputRadio.getName(); final HtmlSelectOneRadio parent = (HtmlSelectOneRadio) (name != null ? UIComponentUtil .findParent(component, HtmlSelectOneRadio.class, name) : component.getParent()); final String valueStr = ValueHolderUtil.getValueForRender(context, parent); final String clientId = parent.getClientId(context); final Converter converter = RendererUtil.findConverter(context, parent); final Object itemValue = htmlInputRadio.getValue(); final String itemValueStr = UIValueUtil.getValueAsString(context, component, itemValue, converter); final boolean checked = valueStr.equals(itemValueStr); final boolean disabled = parent.isDisabled() || htmlInputRadio.isDisabled(); renderRadio(context, htmlInputRadio, itemValueStr, clientId, checked, 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 pointing device is moves out of this element. * * @return the new onmouseout value */ public String getOnmouseout() { if (_onmouseout != null) { return _onmouseout; } ValueExpression expression = getValueExpression("onmouseout"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
comp.setValueExpression("border", _border); comp.setValueExpression("layout", _layout); 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);
/** * <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 String getLayout(UIComponent selectOne) { if (selectOne instanceof HtmlSelectOneRadio) { return ((HtmlSelectOneRadio)selectOne).getLayout(); } return (String)selectOne.getAttributes().get(JSFAttr.LAYOUT_ATTR); }
protected String getStyleClass(UISelectOne selectOne) { if (selectOne instanceof HtmlSelectOneRadio) { return ((HtmlSelectOneRadio)selectOne).getStyleClass(); } return (String)selectOne.getAttributes().get(JSFAttr.STYLE_CLASS_ATTR); }
/** * <p>Set the value of the <code>group</code> property.</p> * @param group the new property value */ public void setGroup(java.lang.String group) { getStateHelper().put(PropertyKeys.group, group); }
protected boolean isDisabled(FacesContext facesContext, UIComponent uiComponent) { //TODO: overwrite in extended HtmlRadioRenderer and check for enabledOnUserRole boolean disabled; boolean readonly; if (uiComponent instanceof HtmlSelectOneRadio) { disabled = ((HtmlSelectOneRadio) uiComponent).isDisabled(); readonly = ((HtmlSelectOneRadio) 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; }