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:
Serializable, Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.ext.Scope, 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
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclass
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
 
Constructor Summary
Radiogroup()
           
 
Method Summary
 Radio appendItem(String label, String value)
          Appends a radio button.
 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.
 List<Radio> getItems()
          Returns a readonly list of Radio.
 String getName()
          Returns the name of this group of radio buttons.
 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 radio group at the given index.
protected  void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
           
 void setName(String name)
          Sets the name of this group of radio buttons.
 void setOrient(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
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, replace, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Radiogroup

public Radiogroup()
Method Detail

getOrient

public String getOrient()
Returns the orient.

Default: "horizontal".


setOrient

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

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

getItems

public List<Radio> getItems()
Returns a readonly list of Radio. Note: any update to the list won't affect the state of this radio group.

Since:
5.0.4

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(String label,
                        String value)
Appends a radio button.


removeItemAt

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

Returns:
the removed radio button.

getName

public 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(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.


renderProperties

protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
                         throws IOException
Overrides:
renderProperties in class XulElement
Throws:
IOException

clone

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


Copyright © 2011. All Rights Reserved.