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

com.sas.servlet.tbeans.form.html.ComboBoxView
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, com.sas.lang.ObjectDataInterface, ComplexStyleInterface, FormElementModificationEventInterface, ComboBoxViewStyleKeysInterface, com.sas.servlet.tbeans.form.JavaScriptObjectCreationInterface, com.sas.servlet.tbeans.JavaScriptEventHandlerInterface, RenderableInterface, TransformationInterface, GenericValidatorInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable

public class ComboBoxView
implements ComboBoxViewStyleKeysInterface, ComplexStyleInterface

The ComboBoxView is a TransformationBean™ that generates the appropriate HTML 4.0 and JavaScript for creating an element representing a ComboBoxView. The ComboBoxView is a menu that allows a single selection from a drop-down list of items. The drop-down list can contain text only, images only, or both text and images together.

The ComboBoxView 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. The items contained in the model should of type JavaScriptNode.

In order for the ComboBoxView Transformation Bean to work properly, sasComponents.css must be included in your .jsp file. This file contains the styles necessary for the ComboBoxView to display properly.

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 ComboBoxView. Hitting TAB while the ComboBoxView has focus will navigate focus to the next tabable component.
ALT+ACCESSKEY Pressing ALT+ACCESSKEY will navigate focus to the ComboBoxView. 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 ComboBoxView 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 ComboBoxView 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 ComboBoxView has focus will collapse and expand drop-down list of items.
UP/DOWN ARROW Pressing UP arrow or DOWN arrow while the ComboBoxView has focus will move through the entries in the drop-down list without opening the list box. The text field portion of the ComboBoxView 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 ComboBoxView 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.

The ComboBoxView 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 ComboBoxView uses the following JavaScript files:

sas_comboBoxView.js
sas_node.js

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:ComboBoxView 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
static java.lang.String PARENT_RB_KEY
           
static java.lang.String RB_KEY
          Key used to lookup resources in the resource bundle.
 
Fields inherited from class com.sas.servlet.tbeans.form.BaseChoiceBox
labelTransform, model
 
Fields inherited from interface com.sas.servlet.tbeans.form.html.ComboBoxViewStyleKeysInterface
COMBOBOXVIEW_ARROW_CELL, COMBOBOXVIEW_ARROW_CELL_VISTA, COMBOBOXVIEW_ARROW_CELL_XP, COMBOBOXVIEW_BUTTON, COMBOBOXVIEW_BUTTON_DIV1, COMBOBOXVIEW_BUTTON_DIV2, COMBOBOXVIEW_BUTTON_DIV3, COMBOBOXVIEW_BUTTON_DIV4, COMBOBOXVIEW_BUTTON_VISTA, COMBOBOXVIEW_BUTTON_XP, COMBOBOXVIEW_EDIT_BUTTON, COMBOBOXVIEW_EDIT_DIV, COMBOBOXVIEW_EDIT_IMAGE_CELL, COMBOBOXVIEW_EDIT_LABEL_DIV1, COMBOBOXVIEW_EDIT_LABEL_DIV1VISTA, COMBOBOXVIEW_EDIT_LABEL_DIV1XP, COMBOBOXVIEW_EDIT_LABEL_DIV2, COMBOBOXVIEW_EDIT_LABEL_DIV2VISTA, COMBOBOXVIEW_EDIT_LABEL_DIV2XP, COMBOBOXVIEW_EDIT_OPTION, COMBOBOXVIEW_EDIT_TABLE, COMBOBOXVIEW_EDIT_TABLE_DISPLAY, COMBOBOXVIEW_EDIT_TEXT_CELL, COMBOBOXVIEW_EDIT_TEXTCTRL, COMBOBOXVIEW_FRAME, COMBOBOXVIEW_FRAME_SELECT, COMBOBOXVIEW_FRAME_TABLE, COMBOBOXVIEW_IMAGES, COMBOBOXVIEW_LABEL_DIV, COMBOBOXVIEW_LABEL_DIV_VISTA, COMBOBOXVIEW_LABEL_DIV_XP, COMBOBOXVIEW_LIST, COMBOBOXVIEW_LIST_DIV, COMBOBOXVIEW_LIST_HIGHLIGHT, COMBOBOXVIEW_LIST_SELECTED, COMBOBOXVIEW_LIST_TABLE, COMBOBOXVIEW_LIST_TEXT, COMBOBOXVIEW_LIST_UNHIGHLIGHT, COMBOBOXVIEW_NO_IMAGES, COMBOBOXVIEW_TABLE, COMBOBOXVIEW_TABLE_CELL_LEFT, COMBOBOXVIEW_TABLE_CELL_LEFT_VISTA, COMBOBOXVIEW_TABLE_CELL_LEFT_XP, COMBOBOXVIEW_TABLE_VISTA, COMBOBOXVIEW_TABLE_XP
 
Constructor Summary
ComboBoxView()
          Construct a new ComboBoxView
ComboBoxView(java.lang.String name, javax.swing.ComboBoxModel model)
          Construct a new ComboBoxView with a specified name and model.
 
Method Summary
protected  void addJSProp(java.lang.StringBuffer props, java.lang.String prefix, java.lang.String propName, java.lang.String propValue)
           
 java.lang.String createNodeParameterString(java.util.Map params)
          Returns a String containing the name/value pairs of the properties to be passed to the JavaScript node constructor.
 java.lang.String getListBoxViewComponentId()
          Gets the id of the ListBoxView component that will be used to as the dropdown portion of the ComboBoxView.
 java.util.Map getNodeConstructorParameters()
          Returns a Map containing the name/value pairs of the properties to be passed to the constructor.
 java.util.Map getStyleMap()
          Returns the style map for this ComoboBoxView.
 void write(java.io.PrintWriter out)
          Writes the transformed representation of the object
 
Methods inherited from class com.sas.servlet.tbeans.form.BaseComboBoxView
getImageLocation, getMaximumRowCount, isEditable, isImagesOnly, isRenderUsingIFrame, setEditable, setImageLocation, setImagesOnly, setMaximumRowCount, setRenderUsingIFrame
 
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
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
Key used to lookup resources in the resource bundle.

See Also:
Constant Field Values

PARENT_RB_KEY

public static final java.lang.String PARENT_RB_KEY
See Also:
Constant Field Values
Constructor Detail

ComboBoxView

public ComboBoxView()
Construct a new ComboBoxView


ComboBoxView

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

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

getStyleMap

public java.util.Map getStyleMap()
Returns the style map for this ComoboBoxView.
STYLE KEY DEFAULT STYLE
COMBOBOXVIEW_EDIT_TEXTCTRL comboBoxViewTextCtrl
COMBOBOXVIEW_EDIT_DIV comboBoxViewDropDown
COMBOBOXVIEW_EDIT_TABLE comboBoxViewTable
COMBOBOXVIEW_EDIT_OPTION comboBoxViewOption
COMBOBOXVIEW_EDIT_TEXT_CELL comboBoxViewTextCell
COMBOBOXVIEW_EDIT_IMAGE_CELL comboBoxViewImageCell
COMBOBOXVIEW_EDIT_BUTTON comboBoxViewEditButton
COMBOBOXVIEW_ARROW_CELL comboBoxViewArrowCell
COMBOBOXVIEW_IMAGES comboBoxViewImages
COMBOBOXVIEW_LIST comboBoxViewList
COMBOBOXVIEW_LABEL_DIV comboBoxViewLabel
COMBOBOXVIEW_LIST_DIV comboBoxViewDropDown
COMBOBOXVIEW_NO_IMAGES comboBoxViewNoImages
COMBOBOXVIEW_LIST_TEXT comboBoxViewListText
COMBOBOXVIEW_LIST_TABLE comboBoxViewListTable
COMBOBOXVIEW_LIST_SELECTED comboBoxViewListSelected
COMBOBOXVIEW_LIST_UNHIGHLIGHT comboBoxViewListUnHighlight
COMBOBOXVIEW_LIST_HIGHLIGHT comboBoxViewListHighlight
COMBOBOXVIEW_ARROW_CELL comboBoxViewArrowCell
COMBOBOXVIEW_BUTTON comboBoxViewButton
COMBOBOXVIEW_TABLE comboBoxViewDisplayTable
COMBOBOXVIEW_TABLE_CELL_LEFT comboBoxViewLeftTableCell
COMBOBOXVIEW_TABLE_CELL_LEFT_XP comboBoxViewLeftTableCellXP
COMBOBOXVIEW_TABLE_XP comboBoxViewDisplayTableXP
COMBOBOXVIEW_LABEL_DIV_XP comboBoxViewLabelXP
COMBOBOXVIEW_ARROW_CELL_XP comboBoxViewArrowCellXP
COMBOBOXVIEW_BUTTON_XP comboBoxViewButtonXP
COMBOBOXVIEW_BUTTON_DIV1 comboBoxViewButtonDiv1
COMBOBOXVIEW_BUTTON_DIV2 comboBoxViewButtonDiv2
COMBOBOXVIEW_BUTTON_DIV3 comboBoxViewButtonDiv3

Specified by:
getStyleMap in interface ComplexStyleInterface
Returns:
styles used for this ComboBoxView

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

getNodeConstructorParameters

public java.util.Map getNodeConstructorParameters()
Returns a Map containing the name/value pairs of the properties to be passed to the constructor.

Returns:
parameters The node constructor parameters

createNodeParameterString

public java.lang.String createNodeParameterString(java.util.Map params)
Returns a String containing the name/value pairs of the properties to be passed to the JavaScript node constructor.

Parameters:
The - map of node constructor parameters
Returns:
The JavaScript representation of the node constructor parameters

getListBoxViewComponentId

public java.lang.String getListBoxViewComponentId()
Gets the id of the ListBoxView component that will be used to as the dropdown portion of the ComboBoxView.

Returns:
The id of the ListBoxView component

addJSProp

protected void addJSProp(java.lang.StringBuffer props,
                         java.lang.String prefix,
                         java.lang.String propName,
                         java.lang.String propValue)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.