DhRadioButton Class

DhRadioButton Class

This Package | All Packages

DhElement
  |
  +--DhBaseContainer
    |
    +--DhRadioButton
public class DhRadioButton
extends DhBaseContainer

Represents the radio button HTML-intrinsic control with a text label. Radio button groups allow for mutually exclusive choices from a list of options.

Constructors
Name Description
DhRadioButton() Creates a DhRadioButton object.
DhRadioButton( String strText, boolean fChecked ) Creates a DhRadioButton object.

Methods
Name Description
addEventHandler( DhEventID id, DhEventHandler handler ) Topic under construction.
getEnabled() Retrieves the enabled state of the button.
getName( ) Retrieves the name of the button.
getSubmitName( ) Retrieves the submit name for this DhRadioButton.
getSubmitValue( ) Retrieves the submit value for this DhRadioButton.
getText( ) Retrieves the current text label for the radio button.
getTextAlignment() Retrieves the current alignment.
setChecked( boolean fValue ) Sets the selected state of the radio button.
setEnabled( boolean f) Sets the enabled state of the button.
setFocus() Sets the input focus to this control.
setName( String n ) Sets the name of the button.
setSubmitName( String strName ) Sets the group name/submit name for this radio button.
setSubmitValue( String strValue ) Sets the submit value for this radio button.
setText( String strText ) Sets the text label of the button.
setTextAlignment( int newAlignment ) Sets the current alignment.
setValue() Retrieves the current selected state of the DhRadioButton.

Constructors

DhRadioButton.DhRadioButton

Syntax 1
public DhRadioButton();
Description

Creates a DhRadioButton object. The default constructor creates a blank DhRadioButton with no check or text label. You set the values to initialize them.



Syntax 2
public DhRadioButton( String strText, boolean fChecked );
Parameters
strText
The label text to display with the button.
fChecked
The initial selected state of the button.
Description

Creates a DhRadioButton object. This constructor creates a radio button with right-aligned text (DhAlignEnum.TEXT_RIGHT).

Methods

DhRadioButton.addEventHandler

Syntax
public void addEventHandler( DhEventID id, DhEventHandler handler );
Description

Topic under construction.

DhRadioButton.getEnabled

Syntax
public boolean getEnabled();
Return Value

Returns true if the button is enabled; returns false if it is not.

Description

Retrieves the enabled state of the button.

DhRadioButton.getName

Syntax
public String getName( );
Return Value

Returns the button name.

Description

Retrieves the name of the button.

DhRadioButton.getSubmitName

Syntax
public String getSubmitName( );
Return Value

Returns the group name.

Description

Retrieves the submit name for this DhRadioButton. The submit name designates which groups of radio buttons are connected. Only one DhRadioButton in a group can be selected at a time.

See Also
setSubmitName

DhRadioButton.getSubmitValue

Syntax
public String getSubmitValue( );
Return Value

Returns the group name.

Description

Retrieves the submit value for this DhRadioButton.

See Also
setSubmitValue

DhRadioButton.getText

Syntax
public String getText( );
Return Value

Returns the text label.

Description

Retrieves the current text label for the radio button.

DhRadioButton.getTextAlignment

Syntax
public synchronized int getTextAlignment();
Return Value

Returns the current alignment.

Description

Retrieves the current alignment. Can be right-aligned (DhAlignEnum.TEXT_RIGHT) or left-aligned (DhAlignEnum.TEXT_LEFT).

DhRadioButton.setChecked

Syntax
public void setChecked( boolean fValue );
Parameters
fValue
Set to true to select the radio button; set to false to clear it.
Description

Sets the selected state of the radio button. If this button is bound and is a member of a group, setting its value can affect other DhRadioButton items in the group.

See Also
setSubmitName, getSubmitName

DhRadioButton.setEnabled

Syntax
public void setEnabled( boolean f );
Parameters
f
Set to true to enable the button; set to false disabled it.
Description

Sets the enabled state of the button.

DhRadioButton.setFocus

Syntax
public void setFocus();
Description

Sets the input focus to this control.

DhRadioButton.setName

Syntax
public void setName( String n );
Description

Sets the name of the button.

DhRadioButton.setSubmitName

Syntax
public void setSubmitName( String strName );
Parameters
strName
The group name. Group names must be unique in each document.
Description

Sets the group name/submit name for this radio button. DhRadioButtons within the same group are mutally exclusive, that is, only one can be selected at a given time. Additionally, group names are used for HTTP form submission.

DhRadioButton.setSubmitValue

Syntax
public void setSubmitValue( String strValue );
Parameters
strName
The group name. Group names must be unique in each document.
Description

Sets the submit value for this radio button. DhRadioButtons within the same group are mutally exclusive, that is, only one can be selected at a given time. The selected item's value is transmitted in the HTTP submit string as [SubmitName]=[SubmitValue]

DhRadioButton.setText

Syntax
public void setText( String strText );
Parameters
strText
The text label of the button.
Description

Sets the text label of the button.

DhRadioButton.setTextAlignment

Syntax
public synchronized void setTextAlignment( int newAlignment );
Parameters
newAlignment
This can be DhAlignEnum.TEXT_LEFT or DhAlignEnum.TEXT_RIGHT.
Description

Sets the current alignment.

DhRadioButton.setValue

Syntax
public boolean setValue();
Return Value

Returns true if the button is selected; otherwise, returns false.

Description

Retrieves the current selected state of the DhRadioButton.