|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.servlet.tbeans.form.html.CheckBox
public class CheckBox
The CheckBox is a TransformationBean that generates the appropriate HTML 4.0 for a checkbox. Checkboxes are on/off switches that may be toggled by the user. A switch is "on" when the control element's checked attribute is set. When a form is submitted, only "on" checkbox controls will be submitted. Several checkboxes in a form may share the same control name. Thus, for example, checkboxes allow users to select several values for the same property. The INPUT element is used to create a checkbox control.
The Section 508 Accessibility standards, such as making application tasks available through the keyboard, are incorporated into our components to improve usability for all of our software products which benefits every SAS user.
This component is fully compliant with the Web-based standards outlined in Section 508. The compliance is based on producing the correct output, having keyboard equivalent and surfacing the necessary properties to assist consumers of the component to be compliant.
The following keyboard equivalents are supported by this component:
KeyBoard Access | Behavior/Result |
---|---|
TAB | TAB moves the focus to the checkbox. Hitting TAB while the checkbox has focus will navigate focus to the next tabbable component. |
ALT+ACCESSKEY | Pressing ALT+ACCESSKEY will navigate focus to the checkbox. The ACCESSKEY indicates the keyboard character used as a shortcut to activate the element. |
SPACEBAR | Pressing the SPACEBAR while the checkbox has focus, toggles between checked and unchecked. |
The following properties are provided to assist in making the application using this component accessible:
The CheckBox is one of several TransformationBeans that rely on a set of style classes that are used by default when generating the resulting markup language. For more information on style sheets and the default style classes that apply to this TransformationBean, refer to the AppDev Studio Developer Site. You'll find a useful reference document entitled Cascading Style Sheets, Images, and TransformationBeans as well as the TransformationBeans Style Sheet Reference.
Note that the toString() method on this class calls the write
method, which may have undesirable side effects. See BaseTransformation.toString() for more information. Debuggers often use toString() to show the value of a variable, and this may cause unexpected behavior while debugging
For More Information:
Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.
Examples for this class may be found on the Examples Site.
JSP custom tags provide an alternative to using the TransformationBeans. Visit the Custom Tag Library Reference for additional information on the sas:CheckBox custom tag.
Note: A snapshot of the AppDev Studio Developers Site is installed on your local Web server when you install AppDev Studio. To access the site from webAF, select Help -> Developer Site .
The CheckBox is one of several TransformationBeans that rely on JavaScript to provide some of its functionality. These JavaScript files are including automatically by the tbean. See JavaScriptIncludeHandler for more information about how these files are included and how to customize this behavior. The CheckBox uses the following JavaScript files:
Field Summary |
---|
Fields inherited from class com.sas.servlet.tbeans.form.BaseFormElement |
---|
RB_KEY |
Fields inherited from interface com.sas.servlet.tbeans.form.html.CheckBoxStyleKeysInterface |
---|
CHECKBOX_BOX, CHECKBOX_LABEL, CHECKBOX_LABEL_SPACING |
Constructor Summary | |
---|---|
CheckBox()
Constructs a new CheckBox Transformation Bean |
|
CheckBox(java.lang.String name)
Constructs a new CheckBox Transformation Bean with a specified name. |
|
CheckBox(java.lang.String name,
java.lang.String text)
Constructs a new CheckBox Transformation Bean with a specified name and initial text. |
|
CheckBox(java.lang.String name,
java.lang.String text,
boolean selected)
Constructs a new CheckBox Transformation Bean with a specified name, initial text and initial state. |
|
CheckBox(java.lang.String name,
java.lang.String text,
boolean selected,
java.lang.String value)
Constructs a new CheckBox Transformation Bean with a specified name, initial text, initial state and initial value. |
|
CheckBox(java.lang.String name,
java.lang.String text,
boolean selected,
java.lang.String value,
boolean submitUncheckedValue,
java.lang.String uncheckedValue)
Constructs a new CheckBox Transformation Bean with a specified name, initial text, initial state, initial value and whether to submit the unchecked value. |
Method Summary | |
---|---|
java.util.Map |
getStyleMap()
Returns the style map for this checkbox. |
java.lang.String |
getUncheckedValue()
The value assigned to the checkbox when it is unchecked. |
java.lang.String |
getUncheckValue()
The value assigned to the checkbox when it is unchecked. |
boolean |
isSubmitUncheckedValue()
Whether to submit the unchecked value through a hidden field when the checkbox is unchecked. |
void |
setSubmitUncheckedValue(boolean submit)
Whether to submit the unchecked value through a hidden field when the checkbox is unchecked. |
void |
setUncheckedValue(java.lang.String value)
The value assigned to the checkbox when it is unchecked. |
void |
write(java.io.PrintWriter out)
Writes the transformed representation of the object |
Methods inherited from class com.sas.servlet.tbeans.form.BaseCheckBox |
---|
getSelected, getText, getValue, isLabelBolding, setLabelBolding, setSelected, setText, setValue |
Constructor Detail |
---|
public CheckBox()
public CheckBox(java.lang.String name)
name
- The CheckBox namepublic CheckBox(java.lang.String name, java.lang.String text)
name
- The CheckBox nametext
- The initial text associated with a CheckBoxpublic CheckBox(java.lang.String name, java.lang.String text, boolean selected)
name
- The CheckBox nametext
- The initial text associated with a CheckBoxselected
- The initial state of the CheckBoxpublic CheckBox(java.lang.String name, java.lang.String text, boolean selected, java.lang.String value)
name
- The CheckBox nametext
- The initial text to be displayed with the CheckBoxselected
- The initial state of the CheckBoxvalue
- The initial value associated with a CheckBoxpublic CheckBox(java.lang.String name, java.lang.String text, boolean selected, java.lang.String value, boolean submitUncheckedValue, java.lang.String uncheckedValue)
name
- The CheckBox nametext
- The initial text to be displayed with the CheckBoxselected
- The initial state of the CheckBoxvalue
- The initial value associated with a CheckBoxsubmitUncheckedValue
- Whether to submit the uncheckedValueuncheckedValue
- The initial value when the CheckBox is uncheckedMethod Detail |
---|
public void setSubmitUncheckedValue(boolean submit)
submitUncheckedValue
- Whether to submit the uncheckedValuepublic boolean isSubmitUncheckedValue()
public void setUncheckedValue(java.lang.String value)
uncheckedValue
- The value when the checkbox is uncheckedpublic java.lang.String getUncheckValue()
public java.lang.String getUncheckedValue()
public java.util.Map getStyleMap()
STYLE KEY | DEFAULT STYLE |
CHECKBOX_BOX | NONE |
CHECKBOX_LABEL | NONE |
CHECKBOX_LABEL_SPACING | NONE |
getStyleMap
in interface ComplexStyleInterface
public void write(java.io.PrintWriter out) throws java.io.IOException
write
in interface TransformationInterface
write
in interface com.sas.util.WriteToPrintWriterInterface
write
in class BaseFormElement
out
- The output stream
java.io.IOException
- Thrown if some type of I/O error occurs
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |