Class RadioGroup
- java.lang.Object
-
- org.apache.tapestry5.corelib.components.RadioGroup
-
- All Implemented Interfaces:
ClientElement
,Field
@Events("validate") public class RadioGroup extends java.lang.Object implements Field
A wrapper component around some number ofRadio
components, used to organize the selection and define the property to be edited. Examples of its use are in theRadio
documentation.Component Parameters Name Type Flags Default Default Prefix clientId String prop: componentResources. id literal The id used to generate a page-unique client-side identifier for the component. If a component renders multiple times, a suffix will be appended to the to id to ensure uniqueness. The uniqued value may be accessed via the clientId property. disabled boolean false prop If true, then the field will render out with a disabled attribute (to turn off client-side behavior). Further, a disabled field ignores any value in the request when the form is submitted. encoder org. apache. tapestry5. ValueEncoder Required, Not Null prop A ValueEncoder used to convert server-side objects (provided by the selected Radio componnent's "value" parameter) into unique client-side strings (typically IDs) and back. Note: this parameter may be OMITTED if Tapestry is configured to provide a ValueEncoder automatically for the type of property bound to the "value" parameter. label String literal The user presentable label for the field. If not provided, a reasonable label is generated from the component's id, first by looking for a message key named "id-label" (substituting the component's actual id), then by converting the actual id to a presentable string (for example, "userId" to "User Id"). validate org. apache. tapestry5. FieldValidator validate The object that will perform input validation. The validate binding prefix is generally used to provide this object in a declarative fashion. value Object Required prop The property read and updated by the group as a whole. Component Events Name Description validate
-
-
Constructor Summary
Constructors Constructor Description RadioGroup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getClientId()
Returns null; the radio group does not render as a tag and so doesn't have an id to share.java.lang.String
getControlName()
java.lang.String
getLabel()
Returns a user presentable (localized) label for the field, which may be used inside <label> elements on the client, and inside client or server-side validation error messages.boolean
isDisabled()
Returns true if the field is disabled; A disabled field will render a disabled attribute so that it is non-responsive on the client (at least, until its disabled status is changed on the client using JavaScript).boolean
isRequired()
Returns true if this field required (as perFieldValidator.isRequired()
).
-
-
-
Constructor Detail
-
RadioGroup
public RadioGroup()
-
-
Method Detail
-
getControlName
public java.lang.String getControlName()
- Specified by:
getControlName
in interfaceField
- Returns:
- the value used as the name attribute of the rendered element. This value will be unique within an enclosing form, even if the same component renders multiple times.
- See Also:
FormSupport.allocateControlName(String)
-
getLabel
public java.lang.String getLabel()
Description copied from interface:Field
Returns a user presentable (localized) label for the field, which may be used inside <label> elements on the client, and inside client or server-side validation error messages.
-
isDisabled
public boolean isDisabled()
Description copied from interface:Field
Returns true if the field is disabled; A disabled field will render a disabled attribute so that it is non-responsive on the client (at least, until its disabled status is changed on the client using JavaScript). A disabled field will ignore any value passed up in a form submit request. Care must be taken if the disabled status of a field can change between the time the field is rendered and the time the enclosing form is submitted.- Specified by:
isDisabled
in interfaceField
- Returns:
- true if disabled, false otherwise
-
getClientId
public java.lang.String getClientId()
Returns null; the radio group does not render as a tag and so doesn't have an id to share. RadioGroup implementsField
only so it can interact with theValidationTracker
.- Specified by:
getClientId
in interfaceClientElement
- Returns:
- null
-
isRequired
public boolean isRequired()
Description copied from interface:Field
Returns true if this field required (as perFieldValidator.isRequired()
).- Specified by:
isRequired
in interfaceField
- Returns:
- true if a non-blank value is required for the field
-
-