001: /* Radiogroup.java
002:
003: {{IS_NOTE
004: Purpose:
005:
006: Description:
007:
008: History:
009: 2007/08/16 18:10:17 , Created by Dennis.Chen
010: }}IS_NOTE
011:
012: Copyright (C) 2007 Potix Corporation. All Rights Reserved.
013:
014: {{IS_RIGHT
015: This program is distributed under GPL Version 2.0 in the hope that
016: it will be useful, but WITHOUT ANY WARRANTY.
017: }}IS_RIGHT
018: */
019: package org.zkoss.jsf.zul;
020:
021: import org.zkoss.jsf.zul.impl.BaseRadiogroup;
022: import org.zkoss.zk.ui.Component;
023:
024: /**
025: * Radiogroup is a JSF component implementation for {@link org.zkoss.zul.Radiogroup},
026: * This class also implements {@link javax.faces.component.EditableValueHolder}.
027: * That means you can use bidirectional value binding, immediate, required, converter, validator, valueChangeListener features on this component.
028: * <br/>
029: * To use those features, you must declare a namespace of "http://java.sun.com/jsf/core"
030: * with a prefix (say 'f' in below example), add attribute of those feature with this namespace
031: * (for example f:required="true")in you jsf page.
032: * For more detail of EditableValueHolder features of JSF, you can refer to <a href="http://java.sun.com/products/jsp/">http://java.sun.com/products/jsp/</a>
033: *
034: * <p/>
035: * You must assign a value on each radio, so that, after user click radio and submitting,
036: * radiogroup will decode the request parameter and set back the submitted value to your bean.
037: * <p/>
038: * The default binding value of this component is {@link java.lang.String}
039: *
040: * <p/>
041: * Example of use bidirectional value binding:<br/>
042: * <pre>
043: * <z:radiogroup id="r2" f:value="#{ConverterTestBean.value}" >
044: * <z:radio value="A" />
045: * <z:radio value="B" />
046: * <z:radio value="C" />
047: * </z:radiogroup>
048: * </pre>
049: *
050: *
051: * <p/>
052: * Example of using immediate:<br/>
053: * <pre>
054: * <z:radiogroup f:immediate="true" />
055: * </pre>
056: *
057: * <p/>
058: * Example of using required:<br/>
059: * <pre>
060: * <z:radiogroup f:required="true" />
061: * </pre>
062: * <p/>
063: * Example of using converter:<br/>
064: * <pre>
065: * <z:radiogroup f:converter="yourBean.convertMethod"/>
066: * or
067: * <z:radiogroup >
068: * <f:converter converterId="yourConverterId"/>
069: * </z:radiogroup>
070: * </pre>
071: * <p/>
072: * Example of using validator:<br/>
073: * <pre>
074: * <z:radiogroup f:validator="yourBean.validateMethod"/>
075: * or
076: * <z:radiogroup >
077: * <f:validator validatorId="yourValidatorId"/>
078: * </z:radiogroup>
079: * </pre>
080: * <p/>
081: * Example of using converter:<br/>
082: * <pre>
083: * <z:radiogroup >
084: * <f:valueChangeListener type="your.ValueChangeListener"/>
085: * </z:radiogroup>
086: * </pre>
087: * <p/>
088: * In some application server which doesn't support attribute namespace you can use attribute prefix 'f_' to replace attribute namespace
089: * <br/>
090: * For example,
091: * <pre>
092: * <z:radiogroup f_value="#{yourBean.value}" />
093: * </pre>
094: *
095: * <p/>
096: * This component should be declared nested under {@link org.zkoss.jsf.zul.Page}.
097: *
098: * <p/>To know more ZK component features you can refer to <a href="http://www.zkoss.org/">http://www.zkoss.org/</a>
099: *
100: * @author Dennis.Chen
101: * @see org.zkoss.zul.Radiogroup
102: * @see javax.faces.component.EditableValueHolder
103: */
104: public class Radiogroup extends BaseRadiogroup {
105:
106: }
|