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

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

public class ListBoxView
implements ListBoxViewStyleKeysInterface, ComplexStyleInterface

The ListBoxView is a TransformationBean™ that generates the appropriate HTML 4.0 for creating a ListBoxView A ListBoxView is a menu that allows either a single selection or multiple selections.

The ListBoxView TransformationBean™ gathers the alternatives from a model via the setModel method. A model must implement the javax.swing.ListModel interface in order to be used. The items contained in the model should of type com.sas.servlet.tbeans.models.JavaScriptNode.

The ListBoxView has the ability to render text only, images only, and text and images together.

Before the form is submitted, you must call the submitSelection() method on the ListBoxView passing in the form as its argument. The submitSelection() method is a javascript function located in sas_listBoxView.js whose purpose is to gather the selected items on the ListBoxView for submission.

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 ListBoxView. Hitting TAB while the ListBoxView has focus will navigate focus to the next tabable component.
ALT+ACCESSKEY Pressing ALT+ACCESSKEY will navigate focus to the ListBoxView. The ACCESSKEY indicates the keyboard character used as a shortcut to activate the element.
SHIFT+UP/DOWN Pressing SHIFT+UP arrow or SHIFT+DOWN arrow while the ListBoxView has focus, moves focus and extends selection in the ListBoxView. If one or more items are selected at the time of the SHIFT+UP/DOWN, selection extends from the last-selected item to the focus item. If none were selected, selection extends from a default item to the focus item. By default, the default item is the first in the list, but if any items were previously selected, the last-selected item becomes the default.
CTRL+UP/DOWN Pressing CTRL+UP arrow or CTRL+DOWN arrow while the ListBoxView has focus, moves focus (but not selection) to the previous/next item in the ListBoxView.
SPACEBAR Pressing SPACEBAR while the ListBoxView has focus, selects the focus item and adds it to the selection. It does not toggle the selected state, nor does it clear the previous selection.
CTRL+SPACEBAR Pressing CTRL+SPACEBAR while the ListBoxView has focus toggles the selected state of the focus item.
SHIFT+SPACEBAR Pressing SHIFT+SPACEBAR while the ListBoxView has focus, extends the selection from the default item to the focus item (rules for the default item are the same as for SHIFT+UP/DOWN arrow keys).
UP/DOWN ARROW Pressing UP arrow or DOWN arrow while the ListBoxView has focus will move through the entries in the list box.

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

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

sas_listBoxView.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:ListBoxView 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.BaseListBox
model
 
Fields inherited from interface com.sas.servlet.tbeans.form.html.ListBoxViewStyleKeysInterface
LISTBOXVIEW_IMAGES, LISTBOXVIEW_INNER_DIV, LISTBOXVIEW_NO_IMAGES, LISTBOXVIEW_OUTER_DIV, LISTBOXVIEW_OUTER_DIV_XP, LISTBOXVIEW_ROW_HIGHLIGHT, LISTBOXVIEW_ROW_UNHIGHLIGHT, LISTBOXVIEW_SELECTED, LISTBOXVIEW_TABLE, LISTBOXVIEW_TABLE_XP, LISTBOXVIEW_TEXT
 
Constructor Summary
ListBoxView()
          Default Constructor for a new ListBoxView
ListBoxView(java.lang.String name, javax.swing.ListModel model)
          Construct a new ListBoxView
 
Method Summary
 java.util.Map getStyleMap()
          Returns the style map for this ListBoxView.
 void write(java.io.PrintWriter out)
          Writes the javascript code which will create the ListBoxView object.
protected  void writeAdditionalInitParams(java.io.PrintWriter out)
          Writes out any additional init parameters All subclasses should override this method to write out any additional params
 
Methods inherited from class com.sas.servlet.tbeans.form.BaseListBoxView
getDeselectNodeFunctionName, getImageLocation, getListConstructorName, getOnMouseDown, getSelectNodeFunctionName, getType, isImagesEnabled, isImagesOnly, setDeselectNodeFunctionName, setImageLocation, setImagesEnabled, setImagesOnly, setListConstructorName, setOnMouseDown, setSelectNodeFunctionName, setType
 
Methods inherited from class com.sas.servlet.tbeans.form.BaseListBox
getModel, getMultipleSelections, getSelectedIndex, getSelectedIndexes, getSelectedItem, getSelectedItems, getSize, isSelected, isSelected, isValidateSelection, setModel, setMultipleSelections, setSelectedIndex, setSelectedIndexes, setSelectedItem, setSelectedItem, setSelectedItems, setSelectedItems, setSize, setValidateSelection
 
Methods inherited from class com.sas.servlet.tbeans.form.BaseFormElement
getAccessKey, getErrorHandler, getModificationEventName, getName, getOnBlur, getOnChange, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, 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, 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

ListBoxView

public ListBoxView()
Default Constructor for a new ListBoxView


ListBoxView

public ListBoxView(java.lang.String name,
                   javax.swing.ListModel model)
Construct a new ListBoxView

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

getStyleMap

public java.util.Map getStyleMap()
Returns the style map for this ListBoxView.
STYLE KEY DEFAULT STYLE
LISTBOXVIEW_OUTER_DIV listBoxViewDropDown
LISTBOXVIEW_INNER_DIV listBoxViewDropDown
LISTBOXVIEW_IMAGES listBoxViewListImages
LISTBOXVIEW_NO_IMAGES listBoxViewListNoImages
LISTBOXVIEW_TEXT listBoxViewListText
LISTBOXVIEW_TABLE listBoxViewListTable
LISTBOXVIEW_SELECTED listBoxViewListSelected
LISTBOXVIEW_ROW_HIGHLIGHT listBoxViewListHighlight
LISTBOXVIEW_ROW_UNHIGHLIGHT listBoxViewListUnHighlight
LISTBOXVIEW_OUTER_DIV_XP listBoxViewDropDownXP
LISTBOXVIEW_TABLE_XP listBoxViewListTableXP

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

writeAdditionalInitParams

protected void writeAdditionalInitParams(java.io.PrintWriter out)
Writes out any additional init parameters All subclasses should override this method to write out any additional params

Parameters:
out - The PrintWriter

write

public void write(java.io.PrintWriter out)
           throws java.io.IOException
Writes the javascript code which will create the ListBoxView object. This generates the html <script> tag that is used to contain all the ListBoxView creation variables. It also generates the ListBoxView initialization function.

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



Copyright © 2009 SAS Institute Inc. All Rights Reserved.