public class Radiogroup extends XulElement
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.
HtmlBasedComponent.ExtraCtrl
AbstractComponent.Children
_zclass
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
Constructor and Description |
---|
Radiogroup() |
Modifier and Type | Method and Description |
---|---|
Radio |
appendItem(java.lang.String label,
java.lang.String value)
Appends a radio button.
|
java.lang.Object |
clone()
Clones the component.
|
Radio |
getItemAtIndex(int index)
Returns the radio button at the specified index.
|
int |
getItemCount()
Returns the number of radio buttons in this group.
|
java.util.List<Radio> |
getItems()
Returns a readonly list of
Radio . |
<T> ListModel<T> |
getModel()
Returns the list model associated with this radiogroup, or null
if this radiogroup is not associated with any list data model.
|
java.lang.String |
getName()
Returns the name of this group of radio buttons.
|
java.lang.String |
getOrient()
Returns the orient.
|
<T> RadioRenderer<T> |
getRadioRenderer()
Returns the renderer to render each radio, or null if the default
renderer is used.
|
int |
getSelectedIndex()
Returns the index of the selected radio button (-1 if no one is selected).
|
Radio |
getSelectedItem()
Returns the selected radio button.
|
void |
onInitRender(Event data)
For model rendering
|
void |
onPageAttached(Page newpage,
Page oldpage)
Default: handles special event listeners.
|
void |
onPageDetached(Page page)
Default: handles special event listeners.
|
Radio |
removeItemAt(int index)
Removes the child radio button in the radio group at the given index.
|
protected void |
renderProperties(ContentRenderer renderer)
Renders the content of this component, excluding the enclosing
tags and children.
|
void |
setModel(ListModel<?> model)
Sets the list model associated with this radiogroup.
|
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 |
setRadioRenderer(RadioRenderer<?> renderer)
Sets the renderer which is used to render each row
if
getModel() is not null. |
void |
setRadioRenderer(java.lang.String clsnm)
Sets the renderer by use of a class name.
|
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.
|
getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
addSclass, evalCSSFlex, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
addAnnotation, addAnnotation, addCallback, 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, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, 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, getShadowFellowIfAny, getShadowRoots, getShadowVariable, 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, invalidatePartial, isChildable, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, 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, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
invalidatePartial
public java.lang.String getOrient()
Default: "horizontal".
public void setOrient(java.lang.String orient) throws WrongValueException
orient
- either "horizontal" or "vertical".WrongValueException
public java.util.List<Radio> getItems()
Radio
.
Note: any update to the list won't affect the state of this radio group.public Radio getItemAtIndex(int index)
public int getItemCount()
public int getSelectedIndex()
public void setSelectedIndex(int jsel)
public Radio getSelectedItem()
public void setSelectedItem(Radio item)
public Radio appendItem(java.lang.String label, java.lang.String value)
public Radio removeItemAt(int index)
public java.lang.String getName()
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.
public void setName(java.lang.String name)
Radio.getName()
).
Don't use this method if your application is purely based on ZK's event-driven model.
protected void renderProperties(ContentRenderer renderer) throws java.io.IOException
HtmlBasedComponent
renderProperties
in class XulElement
java.io.IOException
public <T> ListModel<T> getModel()
public void setModel(ListModel<?> model)
model
- the list model to associate, or null to dis-associate
any previous model.UiException
- if failed to initialize with the modelpublic void onInitRender(Event data)
data
- public <T> RadioRenderer<T> getRadioRenderer()
public void setRadioRenderer(RadioRenderer<?> renderer)
getModel()
is not null.
Note: changing a render will not cause the radiogroup to re-render.
If you want it to re-render, you could assign the same model again
(i.e., setModel(getModel())), or fire an ListDataEvent
event.
renderer
- the renderer, or null to use the default.UiException
- if failed to initialize with the modelpublic void setRadioRenderer(java.lang.String clsnm) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
public java.lang.Object clone()
Component
clone
in interface Component
clone
in class XulElement
public void onPageAttached(Page newpage, Page oldpage)
AbstractComponent
onPageAttached
in interface ComponentCtrl
onPageAttached
in class AbstractComponent
newpage
- the new page (never null).oldpage
- the previous page, if any, or null if it didn't
belong to any page.ComponentCtrl.onPageAttached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Page)
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-2021 Potix Corporation. All Rights Reserved.