Class RadioGroupItem

All Implemented Interfaces:
HasHandlers, HasBlurHandlers, HasChangedHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFocusHandlers, HasIconClickHandlers, HasIconKeyPressHandlers, HasItemHoverHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasPendingStatusChangedHandlers, HasPickerIconClickHandlers, HasShowContextMenuHandlers, HasTitleClickHandlers, HasTitleDoubleClickHandlers, HasTitleHoverHandlers, HasValueHoverHandlers, HasValueIconClickHandlers

public class RadioGroupItem extends FormItem
FormItem that shows a set of mutually exclusive options as a group of radio buttons.
  • Constructor Details

    • RadioGroupItem

      public RadioGroupItem()
    • RadioGroupItem

      public RadioGroupItem(JavaScriptObject jsObj)
    • RadioGroupItem

      public RadioGroupItem(String name)
    • RadioGroupItem

      public RadioGroupItem(String name, String title)
  • Method Details

    • getOrCreateRef

      public static RadioGroupItem getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changePickerIconDefaults

      public static void changePickerIconDefaults(FormItemIcon defaults)
    • setAllowEmptyValue

      public RadioGroupItem setAllowEmptyValue(Boolean allowEmptyValue)
      When set to true, allows a checked RadioItem to be unchecked when clicked, clearing the value from the RadioGroupItem.

      Note that this is not a default behavior of native radios and could impact compliance with accessibility standards depending on the application.

      Parameters:
      allowEmptyValue - New allowEmptyValue value. Default value is false
      Returns:
      RadioGroupItem instance, for chaining setter calls
    • getAllowEmptyValue

      public Boolean getAllowEmptyValue()
      When set to true, allows a checked RadioItem to be unchecked when clicked, clearing the value from the RadioGroupItem.

      Note that this is not a default behavior of native radios and could impact compliance with accessibility standards depending on the application.

      Returns:
      Current allowEmptyValue value. Default value is false
    • setCheckboxItemProperties

      public RadioGroupItem setCheckboxItemProperties(CheckboxItem checkboxItemProperties)
      Properties to apply to the customized CheckboxItem used for radioGroupItems when useNativeRadioItems is false.
      Parameters:
      checkboxItemProperties - New checkboxItemProperties value. Default value is null
      Returns:
      RadioGroupItem instance, for chaining setter calls
      See Also:
    • getCheckboxItemProperties

      public CheckboxItem getCheckboxItemProperties()
      Properties to apply to the customized CheckboxItem used for radioGroupItems when useNativeRadioItems is false.
      Returns:
      Current checkboxItemProperties value. Default value is null
      See Also:
    • setEditProxyConstructor

      public RadioGroupItem setEditProxyConstructor(String editProxyConstructor)
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      setEditProxyConstructor in class FormItem
      Parameters:
      editProxyConstructor - New editProxyConstructor value. Default value is "RadioGroupItemEditProxy"
      Returns:
      RadioGroupItem instance, for chaining setter calls
      See Also:
    • getEditProxyConstructor

      public String getEditProxyConstructor()
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      getEditProxyConstructor in class FormItem
      Returns:
      Current editProxyConstructor value. Default value is "RadioGroupItemEditProxy"
      See Also:
    • setFillHorizontalSpace

      public RadioGroupItem setFillHorizontalSpace(boolean fillHorizontalSpace)
      If vertical is false, and this item has a specified width, should options be spread out evenly to fill the specified width?
      Parameters:
      fillHorizontalSpace - New fillHorizontalSpace value. Default value is false
      Returns:
      RadioGroupItem instance, for chaining setter calls
      See Also:
    • getFillHorizontalSpace

      public boolean getFillHorizontalSpace()
      If vertical is false, and this item has a specified width, should options be spread out evenly to fill the specified width?
      Returns:
      Current fillHorizontalSpace value. Default value is false
      See Also:
    • setTextBoxStyle

      public RadioGroupItem setTextBoxStyle(String textBoxStyle)
      Base CSS class applied to the text for items within this radio group.

      If this method is called after the component has been drawn/initialized: Setter for textBoxStyle.
      Overrides:
      setTextBoxStyle in class FormItem
      Parameters:
      textBoxStyle - new textBoxStyle. Default value is "labelAnchor"
      Returns:
      RadioGroupItem instance, for chaining setter calls
      See Also:
    • getTextBoxStyle

      public String getTextBoxStyle()
      Base CSS class applied to the text for items within this radio group.
      Overrides:
      getTextBoxStyle in class FormItem
      Returns:
      Current textBoxStyle value. Default value is "labelAnchor"
      See Also:
    • setUseNativeRadioItems

      public RadioGroupItem setUseNativeRadioItems(boolean useNativeRadioItems)
      When set to false, replaces each native radio element in the group with a CheckboxItem which can be customized via checkboxItemProperties.
      Parameters:
      useNativeRadioItems - New useNativeRadioItems value. Default value is true
      Returns:
      RadioGroupItem instance, for chaining setter calls
      See Also:
    • getUseNativeRadioItems

      public boolean getUseNativeRadioItems()
      When set to false, replaces each native radio element in the group with a CheckboxItem which can be customized via checkboxItemProperties.
      Returns:
      Current useNativeRadioItems value. Default value is true
      See Also:
    • setVertical

      public RadioGroupItem setVertical(Boolean vertical)
      True == display options vertically, false == display in a single row
      Parameters:
      vertical - New vertical value. Default value is true
      Returns:
      RadioGroupItem instance, for chaining setter calls
      See Also:
    • getVertical

      public Boolean getVertical()
      True == display options vertically, false == display in a single row
      Returns:
      Current vertical value. Default value is true
      See Also:
    • setWrap

      public RadioGroupItem setWrap(Boolean wrap)
      Should the text for items within this radio group wrap?
      Parameters:
      wrap - New wrap value. Default value is null
      Returns:
      RadioGroupItem instance, for chaining setter calls
      See Also:
    • getWrap

      public Boolean getWrap()
      Should the text for items within this radio group wrap?
      Returns:
      Current wrap value. Default value is null
      See Also:
    • pendingStatusChanged

      public boolean pendingStatusChanged(DynamicForm form, FormItem item, boolean pendingStatus, Object newValue, Object value)
      Notification method called when showPending is enabled and this radio group should either clear or show its pending visual state.

      The default behavior is that the titleStyle and cellStyle are updated to include/exclude the "Pending" suffix. In addition, the label for the newly-selected option will have a different color. Returning false will cancel this default behavior.

      Parameters:
      form - the managing DynamicForm instance.
      item - the form item itself (also available as "this").
      pendingStatus - true if the item should show its pending visual state; false otherwise.
      newValue - the current form item value.
      value - the value that would be restored by a call to DynamicForm.resetValues().
      Returns:
      false to cancel the default behavior.
    • setDefaultProperties

      public static void setDefaultProperties(RadioGroupItem radioGroupItemProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties of the class instance passed to this function. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      radioGroupItemProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • getValueAsString

      public String getValueAsString()
      Return the value tracked by this form item.
      Returns:
      value of this element
    • setValueDisabled

      public void setValueDisabled(Object value, boolean disabled)
      Disable or Enable a specific option within this radioGroup
      Parameters:
      value - value of option to disable
      disabled - true to disable the option, false to enable it
    • setValueHoverFormatter

      public void setValueHoverFormatter(FormItemHoverFormatter hoverFormatter)
      The FormItemHoverFormatter should return the HTML to display in a hover canvas when the user holds the mousepointer over a particular value in this item. Return null to suppress the hover canvas altogether.
      Overrides:
      setValueHoverFormatter in class FormItem
      Parameters:
      hoverFormatter - the hover formatter
    • setItemProperties

      public void setItemProperties(FormItem itemProperties) throws IllegalStateException
      Properties to apply to all generated items within this RadioGroup. This allows you to customize the generated radio items for this item. Note that this intended for simple customizations where there is no direct equivalent setting available on the RadioGroupItem itself - for example appearance settings such as showFocused. Some customizations (for example attempting to set the name for the item) are invalid and unsupported.

      Note : This is an advanced setting.

      Parameters:
      itemProperties -
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created