com.sas.servlet.beans
Interface ListboxInterface

All Known Implementing Classes:
BaseListbox

public interface ListboxInterface
extends TransformationInterface, ComponentInterface

Transformation bean definition for creating a Listbox input field. A Listbox element is a menu that allows either single or multiple selections.


Method Summary
 StaticOrderedCollectionInterface getDescriptionModel()
          Gets the model to be used for the descriptions of the listbox entry.
 boolean getMultipleSelections()
          Gets the multiple selection attribute
 int getSelectedIndex()
          Gets the index of single item to be marked as selected.
 int[] getSelectedIndexes()
          Gets the array of index values of items to be marked as selected.
 String getSelectedItem()
          Gets the value of a single item to be marked as selected.
 StaticOrderedCollectionInterface getSelectedItems()
          Gets the collection of values of items to be marked as selected.
 int getSize()
          Gets the size attribute
 void setDescriptionModel(StaticOrderedCollectionInterface model)
          Sets the model to be used for the descriptions of the listbox entry.
 void setMultipleSelections(boolean value)
          Sets the multiple selection attribute allowing multiple selections of values in the list.
 void setSelectedIndex(int value)
          Sets the index of single item to be marked as selected.
 void setSelectedIndexes(int[] value)
          Sets an array of index values for items to be marked as selected.
 void setSelectedItem(String value)
          Sets the value of a single item to be marked as selected.
 void setSelectedItems(StaticOrderedCollectionInterface values)
          Sets a collection of values of items to be marked as selected.
 void setSize(int value)
          Sets the size attribute.
 
Methods inherited from interface com.sas.servlet.beans.TransformationInterface
getCustomAttributes, getDescription, getName, getParent, getRequest, getResponse, setCustomAttributes, setDescription, setName, setParent, setRequest, setResponse, write, write, write, write
 

Method Detail

setSize

public void setSize(int value)
Sets the size attribute. The default value is 4.
Parameters:
size - The maximum number of values visible to the user

getSize

public int getSize()
Gets the size attribute
Returns:
The maximum number of values visible to the user

setMultipleSelections

public void setMultipleSelections(boolean value)
Sets the multiple selection attribute allowing multiple selections of values in the list. The default is false.
Parameters:
multiple - true if multiple selections are allowed

getMultipleSelections

public boolean getMultipleSelections()
Gets the multiple selection attribute
Returns:
true if multiple selections are allowed

setSelectedIndex

public void setSelectedIndex(int value)
                      throws IOException
Sets the index of single item to be marked as selected. Setting the index will also update the corresponding selectedItem.
Parameters:
index - The 0-based index of the item to be selected, or -1 for none

setSelectedIndexes

public void setSelectedIndexes(int[] value)
                        throws IOException
Sets an array of index values for items to be marked as selected. Setting the index will also update the corresponding selectedItems.
Parameters:
indexArray - An array of 0-based index values for items to be selected

getSelectedIndex

public int getSelectedIndex()
Gets the index of single item to be marked as selected. If more than one index has been set this will return a -1.
Returns:
The array of 0-based values, or null for none

getSelectedIndexes

public int[] getSelectedIndexes()
Gets the array of index values of items to be marked as selected. If only a single index has been set this will return a single element array with the value.
Returns:
The array of 0-based values, or null for none

setSelectedItem

public void setSelectedItem(String value)
                     throws IOException
Sets the value of a single item to be marked as selected. Setting the value will also update the corresponding selectedIndex.
Parameters:
value - The value of the item to be selected

setSelectedItems

public void setSelectedItems(StaticOrderedCollectionInterface values)
                      throws IOException
Sets a collection of values of items to be marked as selected. Setting the value will also update the corresponding selectedIndexes.
Parameters:
values - The collection of values to be marked as selected

getSelectedItem

public String getSelectedItem()
Gets the value of a single item to be marked as selected. If more than one value has been set this will return a blank string
Returns:
The collection of selected values, or null for none

getSelectedItems

public StaticOrderedCollectionInterface getSelectedItems()
Gets the collection of values of items to be marked as selected. If only a single value has been set this will return a StringCollection with only one element
Returns:
The collection of selected values, or null for none

setDescriptionModel

public void setDescriptionModel(StaticOrderedCollectionInterface model)
Sets the model to be used for the descriptions of the listbox entry. The default is to use the model specified in setModelInterface, which will cause the value of the listbox to be the same as the text.
Parameters:
model - The collection to use for the descriptions

getDescriptionModel

public StaticOrderedCollectionInterface getDescriptionModel()
Gets the model to be used for the descriptions of the listbox entry. The default is to use the model specified in setModelInterface.
Returns:
The collection to use for the descriptions


Version: 1.2.20000317.001 Formatted: 2000/07/06 15:57:33PM