Interface UiRadioChoice<V>

Type Parameters:
V - type of the value and option.
All Superinterfaces:
AttributeReadAttached, AttributeReadEnabled, AttributeReadId, AttributeReadValid, AttributeReadValue<V>, AttributeReadVisible, AttributeWriteEnabled, AttributeWriteId, AttributeWritePrefix, AttributeWriteReadOnly, AttributeWriteSuffix, AttributeWriteTooltip, AttributeWriteValidationFailure, AttributeWriteValue<V>, AttributeWriteValueForUser<V>, AttributeWriteVisible, EventSource<UiEvent,UiEventListener>, UiAbstractChoice<V,V>, UiAbstractInput<V>, UiAbstractSingleChoice<V>, UiInput<V>, UiNativeWidget, UiRegularWidget, UiValidatableWidget<V>, UiValuedWidget<V>, UiWidget

public interface UiRadioChoice<V> extends UiAbstractSingleChoice<V>, UiNativeWidget
UiAbstractSingleChoice to select a value from a group of UiRadioButtons. You should only use this input widget when you have a small number of options with rather short text (2-5 options not longer than 10 characters each). Otherwise you should use alternatives such as UiComboBox for better UX.
Example:
 Matrimony:  single  married  divorced
 

ATTENTION: Initially no option is selected and the value may be null. You can set a reasonable initial value as default. However, it is often better to force the end-user to make his choice. As null is not a good choice in most cases you typically want to set a validator that is mandatory then.
NOTICE: Depending on the implementation you may receive a focus loss event immediately followed by a focus gain event in case the end-user changes focus from one option to another. However, other implementations may not send events in this case.
Since:
1.0.0
  • Method Details

    • of

      static <V> UiRadioChoice<V> of(String name)
      Type Parameters:
      V - type of the options.
      Parameters:
      name - the name (label).
      Returns:
      the new widget instance.
    • ofEnum

      static <V extends Enum<?>> UiRadioChoice<V> ofEnum(String name, Class<V> enumType)
      Type Parameters:
      V - type of the options.
      Parameters:
      name - the name (label).
      enumType - the Class reflecting an Enum defining the options.
      Returns:
      the new widget instance.
    • of

      static <V> UiRadioChoice<V> of(String name, V... options)
      Type Parameters:
      V - type of the options.
      Parameters:
      name - the name (label).
      options - the options.
      Returns:
      the new widget instance.