Interface IRadio

All Superinterfaces:
IAnyGroup<IRadio>, ICheckboxBase<IRadio>, IChildrenOfInputgroup<IRadio>, IComponent<IRadio>, IHtmlBasedComponent<IRadio>, ILabelElement<IRadio>, ILabelImageElement<IRadio>, IXulElement<IRadio>

public interface IRadio extends ICheckboxBase<IRadio>, IAnyGroup<IRadio>
Immutable Radio component

A radio button.

Radio buttons without a ancestor IRadiogroup is considered as the same group. The nearest ancestor IRadiogroup is the group that the radio belongs to.

Support @Action

Name Action Type
onCheck ActionData: CheckData
Denotes when a component is checked or unchecked.
onFocus Denotes when a component gets the focus. Remember event listeners execute at the server, so the focus at the client might be changed when the event listener for onFocus got executed.
onBlur Denotes when a component loses the focus. Remember event listeners execute at the server, so the focus at the client might be changed when the event listener for onBlur got executed.
Author:
katherine
See Also:
  • Radio
  • Field Details

    • DEFAULT

      static final IRadio DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.wgt.Radio"

      Specified by:
      getWidgetClass in interface IComponent<IRadio>
    • getRadiogroup

      @Nullable String getRadiogroup()
      Returns the id of the IRadiogroup that groups this radio

      Default: null

    • withRadiogroup

      IRadio withRadiogroup(@Nullable String radiogroupId)
      Returns a copy of this immutable component with the specified radiogroupId.

      Sets the id of the IRadiogroup that groups this radio

      Parameters:
      radiogroupId - The id of IRadiogroup.

      Default: null.

      Returns:
      A modified copy of the this object
    • isSelected

      @Lazy default boolean isSelected()
      Returns whether it is selected.

      Default: false.

    • withSelected

      default IRadio withSelected(boolean selected)
      Returns a copy of this immutable component with the specified selected.

      Sets to select the radio or not.

      Parameters:
      selected - Whether to select the radio.

      Default: false.

      Returns:
      A modified copy of the this object
    • of

      static IRadio of(String label)
      Returns the instance with the given label.
      Parameters:
      label - The label of the component
    • of

      static IRadio of(String label, String image)
      Returns the instance with the given label and image.
      Parameters:
      label - The label of the component
      image - The image of the component
    • ofImage

      static IRadio ofImage(String image)
      Returns the instance with the given image.
      Parameters:
      image - The image of the component
    • ofId

      static IRadio ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component