org.zkoss.zul
Class Radiogroup

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.Radiogroup
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl

public class Radiogroup
extends XulElement

A radio group.

Note: To support the versatile layout, a radio group accepts any kind of children, including Radio. On the other hand, the parent of a radio, if any, must be a radio group.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
Radiogroup()
           
 
Method Summary
 Radio appendItem(java.lang.String label, java.lang.String value)
          Appends a radio button.
 java.lang.Object clone()
           
 Radio getItemAtIndex(int index)
          Returns the radio button at the specified index.
 int getItemCount()
          Returns the number of radio buttons in this group.
 java.lang.String getName()
          Returns the name of this group of radio buttons.
 java.lang.String getOrient()
          Returns the orient.
 int getSelectedIndex()
          Returns the index of the selected radio button (-1 if no one is selected).
 Radio getSelectedItem()
          Returns the selected radio button.
 Radio removeItemAt(int index)
          Removes the child radio button in the list box at the given index.
 void setName(java.lang.String name)
          Sets the name of this group of radio buttons.
 void setOrient(java.lang.String orient)
          Sets the orient.
 void setSelectedIndex(int jsel)
          Deselects all of the currently selected radio button and selects the radio button with the given index.
 void setSelectedItem(Radio item)
          Deselects all of the currently selected radio buttons and selects the given radio button.
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getAllOnClickAttrs, getContext, getInnerAttrs, getOuterAttrs, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, newExtraCtrl, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isChildable, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Radiogroup

public Radiogroup()
Method Detail

getOrient

public java.lang.String getOrient()
Returns the orient.

Default: "horizontal".


setOrient

public void setOrient(java.lang.String orient)
               throws org.zkoss.zk.ui.WrongValueException
Sets the orient.

Parameters:
orient - either "horizontal" or "vertical".
Throws:
org.zkoss.zk.ui.WrongValueException

getItemAtIndex

public Radio getItemAtIndex(int index)
Returns the radio button at the specified index.


getItemCount

public int getItemCount()
Returns the number of radio buttons in this group.


getSelectedIndex

public int getSelectedIndex()
Returns the index of the selected radio button (-1 if no one is selected).


setSelectedIndex

public void setSelectedIndex(int jsel)
Deselects all of the currently selected radio button and selects the radio button with the given index.


getSelectedItem

public Radio getSelectedItem()
Returns the selected radio button.


setSelectedItem

public void setSelectedItem(Radio item)
Deselects all of the currently selected radio buttons and selects the given radio button.


appendItem

public Radio appendItem(java.lang.String label,
                        java.lang.String value)
Appends a radio button.


removeItemAt

public Radio removeItemAt(int index)
Removes the child radio button in the list box at the given index.

Returns:
the removed radio button.

getName

public java.lang.String getName()
Returns the name of this group of radio buttons. All child radio buttons shared the same name (Radio.getName()).

Default: automatically generated an unique name

Don't use this method if your application is purely based on ZK's event-driven model.


setName

public void setName(java.lang.String name)
Sets the name of this group of radio buttons. All child radio buttons shared the same name (Radio.getName()).

Don't use this method if your application is purely based on ZK's event-driven model.


clone

public java.lang.Object clone()
Specified by:
clone in interface org.zkoss.zk.ui.Component
Overrides:
clone in class org.zkoss.zk.ui.AbstractComponent


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.