com.sas.servlet.tbeans.form.html
Class ChoiceBox

com.sas.servlet.tbeans.form.html.ChoiceBox
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, com.sas.lang.ObjectDataInterface, FormElementModificationEventInterface, com.sas.servlet.tbeans.form.JavaScriptObjectCreationInterface, com.sas.servlet.tbeans.JavaScriptEventHandlerInterface, RenderableInterface, StyleInterface, TransformationInterface, GenericValidatorInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable
Direct Known Subclasses:
CellContentsChoiceBoxEditor

public class ChoiceBox
implements StyleInterface

The ChoiceBox is a TransformationBean™ that generates the appropriate HTML 4.0 for creating an HTML SELECT element representing a ChoiceBox. The choicebox is a menu that allows a single selection selection from a drop-down list of items.

The ChoiceBox TransformationBean™ gathers the alternatives from a model via the setModel method. A model must implement the javax.swing.ComboBoxModel interface in order to be used.

Accessibility

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 AccessBehavior/Result
TAB TAB moves the focus to the choicebox. Hitting TAB while the choicebox has focus will navigate focus to the next tabable component.
ALT+ACCESSKEY Pressing ALT+ACCESSKEY will navigate focus to the choicebox. The ACCESSKEY indicates the keyboard character used as a shortcut to activate the element.
ALT+UP/DOWN Pressing ALT+UP arrow or ALT+DOWN arrow while the choicebox has focus, opens the drop-down list box. With it open, the user can move through the entries in the list by using either arrow keys or character keys. As the user navigates through the list, the text field portion of the choicebox is updated with the current selection. Pressing ENTER, TAB, ESC, or using the mouse to click outside of the control, selects the current item and closes the drop-down list box.
ENTER Pressing the ENTER key while the choicebox has focus will collapse and expand drop-down list of items.
UP/DOWN ARROW Pressing UP arrow or DOWN arrow while the choicebox has focus will move through the entries in the drop-down list without opening the list box. The text field portion of the choicebox is updated with the next/previous entry in the list.

The following properties are provided to assist in making the application using this component accessible:

The ChoiceBox 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:ChoiceBox 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 .

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.sas.servlet.tbeans.form.BaseChoiceBox
labelTransform, model, RB_KEY
 
Constructor Summary
ChoiceBox()
          Construct a new ChoiceBox
ChoiceBox(java.lang.String name, javax.swing.ComboBoxModel model)
          Construct a new ChoiceBox with a specified name and model.
 
Method Summary
 void write(java.io.PrintWriter out)
          Writes the transformed representation of the object
protected  void writeLaunchFunction(java.io.PrintWriter out)
           
 
Methods inherited from class com.sas.servlet.tbeans.form.BaseChoiceBox
getModel, getSelectedIndex, getSelectedItem, getValueItemLabel, isSelected, isSelected, isValidateSelection, setModel, setSelectedIndex, setSelectedItem, setSelectedItem, setValidateSelection
 
Methods inherited from class com.sas.servlet.tbeans.form.BaseFormElement
getAccessKey, getErrorHandler, getModificationEventName, getName, getOnBlur, getOnChange, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnSelect, getStyleInfo, getTabIndex, getTitle, getValidationFunctions, getValidator, isEnabled, isValid, isValidationEnabled, setAccessKey, setEnabled, setErrorHandler, setId, setModificationEventName, setName, setOnBlur, setOnChange, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setStyleInfo, setTabIndex, setTitle, setValidator, writeJavaScriptObject, writeJavaScriptObjectValidate, writeJavaScriptValidatorObject, writeValidationScript
 
Methods inherited from class com.sas.servlet.tbeans.BaseTransformation
addPropertyChangeListener, addPropertyChangeListener, cleanUpResources, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCustomAttributes, getDescription, getId, getInputTransform, getLocale, getObjectData, getObjectDataProperty, getOutputTransform, getRequest, getResponse, getTagEpilog, getTagProlog, hasListeners, isCleanUpResourcesOn, isVisible, removePropertyChangeListener, removePropertyChangeListener, setCleanUpResourcesOn, setCustomAttributes, setDescription, setInputTransform, setLocale, setLocaleDependentProperties, setObjectData, setObjectDataProperty, setOutputTransform, setRequest, setResponse, setTagEpilog, setTagProlog, setVisible, toString, write, write, write
 
Methods inherited from interface com.sas.servlet.tbeans.StyleInterface
getStyleInfo, setStyleInfo
 

Constructor Detail

ChoiceBox

public ChoiceBox()
Construct a new ChoiceBox


ChoiceBox

public ChoiceBox(java.lang.String name,
                 javax.swing.ComboBoxModel model)
Construct a new ChoiceBox with a specified name and model.

Parameters:
name - The field name
model - The model for the choicebox alternatives
Method Detail

write

public void write(java.io.PrintWriter out)
           throws java.io.IOException
Writes the transformed representation of the object

Specified by:
write in interface TransformationInterface
Specified by:
write in interface com.sas.util.WriteToPrintWriterInterface
Overrides:
write in class BaseFormElement
Parameters:
out - The output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeLaunchFunction

protected void writeLaunchFunction(java.io.PrintWriter out)
                            throws java.io.IOException
Throws:
java.io.IOException



Copyright © 2009 SAS Institute Inc. All Rights Reserved.