Class RadioGroup
java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.components.Div
io.mindspice.simplypages.components.forms.RadioGroup
- All Implemented Interfaces:
Component
Radio button group with shared input name and
radiogroup role.
Form.addField(String, Component) names the group from its visible caption without
changing option labels. Standalone groups need an application-supplied accessible name through
the existing aria-label or aria-labelledby attribute APIs; the submission name
is not used as an accessible name.
Mutable and not thread-safe. Options are accumulated in-memory and rendered in insertion order. Mutate within a request-scoped flow. For reuse, stop mutating and render as a stable structure with per-request slot/context values.
-
Field Summary
Fields inherited from class HtmlTag
attributes, children, id, innerText, innerTextSlot, selfClosing, tagName, trustedHtml -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAppends one option.static RadioGroupCreates a radio group.Builds radio-option wrappers and appends inherited children.inline()Addsradio-inlineclass.required()Marks current and subsequently added options as required.withSelectedValue(String value) Sets selected option value.Methods inherited from class Div
withAttribute, withChild, withClass, withIdMethods inherited from class HtmlTag
addClass, addStyle, addTrustedStyle, getId, hxDelete, hxGet, hxInclude, hxPatch, hxPost, hxPushUrl, hxPut, hxScrollTargetTop, hxSwap, hxTarget, hxTrigger, render, withInnerText, withInnerText, withMaxWidth, withMinWidth, withUnsafeHtml, withWidth
-
Constructor Details
-
RadioGroup
-
-
Method Details
-
create
Creates a radio group.- Parameters:
name- shared radio input name- Returns:
- new radio group
-
addOption
Appends one option.- Parameters:
value- option valuelabel- option label- Returns:
- this group
-
withSelectedValue
Sets selected option value.- Parameters:
value- value matched during render- Returns:
- this group
-
required
Marks current and subsequently added options as required.- Returns:
- this group
-
inline
-
getChildrenStream
Builds radio-option wrappers and appends inherited children.- Overrides:
getChildrenStreamin classHtmlTag- Returns:
- child stream
-