Class RadioChoiceCallback

java.lang.Object
javax.security.auth.callback.ChoiceCallback
org.forgerock.openam.authentication.callbacks.RadioChoiceCallback
All Implemented Interfaces:
Serializable, Callback

@Supported public final class RadioChoiceCallback extends ChoiceCallback
A marker subclass of ChoiceCallback that signals to UIs that the choices should be rendered as radio buttons.

The on-the-wire JSON type remains "ChoiceCallback" for backwards compatibility. An additional output field {"name":"radio","value":true} is included in the response so that UIs that understand it can branch to radio-button rendering, while older UIs fall back to their existing ChoiceCallback rendering without error.

Radio buttons are inherently single-select; multiple selections are not supported by this callback.

Use this callback type via:

  • ChoiceCollectorNode when its radio config attribute is true.
  • callbacks.radioChoiceCallback(...) inside a ScriptedDecisionNode script.

See Also:
  • Constructor Details

    • RadioChoiceCallback

      @Supported public RadioChoiceCallback(String prompt, String[] choices, int defaultChoice)
      Constructs a RadioChoiceCallback with a prompt, a list of choices, and a default choice.
      Parameters:
      prompt - the prompt used to describe the list of choices.
      choices - the list of choices.
      defaultChoice - the index of the default choice.
      Throws:
      IllegalArgumentException - if prompt is null/empty, choices is null/empty, any choice is null/empty, or defaultChoice is out of range.