public class Radio extends Checkbox
Radio buttons without a ancestor Radiogroup
is considered
as the same group.
The nearest ancestor Radiogroup
is the group that the radio
belongs to. See also getRadiogroup()
.
Event:
CheckEvent
is sent when a checkbox
is checked or unchecked by user.LabelImageElement.ExtraCtrl
AbstractComponent.Children
_zclass
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
Constructor and Description |
---|
Radio() |
Radio(java.lang.String label) |
Radio(java.lang.String label,
java.lang.String image) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
Returns the name of this radio button.
|
Radiogroup |
getRadiogroup()
Returns
Radiogroup that this radio button belongs to. |
java.lang.String |
getZclass()
Returns the Style of radio label
Default: "z-radio"
Since 3.5.1
|
boolean |
isSelected()
Returns whether it is selected.
|
void |
onPageDetached(Page page)
Default: handles special event listeners.
|
protected void |
renderProperties(ContentRenderer renderer)
Renders the content of this component, excluding the enclosing
tags and children.
|
void |
service(AuRequest request,
boolean everError)
Processes an AU request.
|
void |
setChecked(boolean checked)
Sets the radio is checked and unchecked the others in the same radio
group (
Radiogroup . |
void |
setParent(Component parent)
Sets the parent component.
|
void |
setRadiogroup(Radiogroup radiogroup)
Associates the radiogroup to this radio component.
|
void |
setRadiogroup(java.lang.String radiogroupId)
Associates the radiogroup to this radio component by giving ID.
|
void |
setSelected(boolean selected)
Sets whether it is selected.
|
getAutodisable, getTabindex, getValue, isChecked, isChildable, isDisabled, setAutodisable, setDisabled, setName, setTabindex, setValue, updateByClient
clone, getExtraCtrl, getHoverImage, getHoverImageContent, getIconSclass, getImage, getImageContent, getPropertyAccess, getSrc, isImageAssigned, setHoverImage, setHoverImageContent, setHoverImageContent, setIconSclass, setImage, setImageContent, setImageContent, setSrc
getLabel, renderCrawlable, setLabel
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
focus, getAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowRoots, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
public Radio()
public Radio(java.lang.String label)
public Radio(java.lang.String label, java.lang.String image)
public Radiogroup getRadiogroup()
Radiogroup
that this radio button belongs to.
It is the nearest ancestor Radiogroup
.
In other words, it searches up the parent, parent's parent
and so on for any Radiogroup
instance.
If found this radio belongs the found radiogroup.
If not, this radio itself is a group.public void setRadiogroup(Radiogroup radiogroup)
public void setRadiogroup(java.lang.String radiogroupId)
radiogroupId
- the ID of the radiogroup. To specify UUID,
use the format: uuid(comp_uuid)
.public boolean isSelected()
Default: false.
Don't override this. Override Checkbox.isChecked()
instead.
public void setSelected(boolean selected)
Don't override this. Override setChecked(boolean)
instead.
The same as setChecked(boolean)
.
public void setChecked(boolean checked)
Radiogroup
.setChecked
in class Checkbox
public java.lang.String getName()
Don't use this method if your application is purely based on ZK's event-driven model.
It is readonly, and it is generated automatically
to be the same as its parent's name (Radiogroup.getName()
).
public java.lang.String getZclass()
Default: "z-radio"
Since 3.5.1
getZclass
in class Checkbox
HtmlBasedComponent.getSclass()
public void setParent(Component parent)
Component
Note: Component.setParent(org.zkoss.zk.ui.Component)
always calls back Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and/or Component.removeChild(org.zkoss.zk.ui.Component)
,
while Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and Component.removeChild(org.zkoss.zk.ui.Component)
always calls back Component.setParent(org.zkoss.zk.ui.Component)
,
if the parent is changed. Thus, you don't need to override
both Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and Component.setParent(org.zkoss.zk.ui.Component)
, if you want
to customize the behavior.
setParent
in interface Component
setParent
in class AbstractComponent
protected void renderProperties(ContentRenderer renderer) throws java.io.IOException
HtmlBasedComponent
renderProperties
in class Checkbox
java.io.IOException
public void service(AuRequest request, boolean everError)
service
in interface ComponentCtrl
service
in class Checkbox
everError
- whether any error ever occurred before
processing this request.AbstractComponent.setAuService(org.zkoss.zk.au.AuService)
public void onPageDetached(Page page)
AbstractComponent
onPageDetached
in interface ComponentCtrl
onPageDetached
in class AbstractComponent
page
- the previous page (never null)ComponentCtrl.onPageDetached(org.zkoss.zk.ui.Page)
Copyright © 2005-2011 Potix Corporation. All Rights Reserved.