com.sas.servlet.tbeans.dualselector.html
Class DualSelector

com.sas.servlet.tbeans.dualselector.html.DualSelector
All Implemented Interfaces:
HttpActionProviderInterface, com.sas.beans.PropertyChangeSource, com.sas.lang.ObjectDataInterface, com.sas.servlet.tbeans.AJAXControllerURLInterface, ComplexStyleInterface, CompositeComponentInterface, DualSelectorKeysInterface, DualSelectorStyleKeysInterface, FormViewInterface, RenderableInterface, TemplateInterface, com.sas.servlet.tbeans.TemplateKeyInterface, TransformationInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable
Direct Known Subclasses:
DualListSelector, DualTreeSelector, TreeListSelector

public abstract class DualSelector
implements FormViewInterface, DualSelectorStyleKeysInterface

Abstract DualSelector class used for displaying two components and selecting/moving items from a source to a target component.

Default Component names:
<nameOfDualSelector>_sourceLabel
<nameOfDualSelector>_targetLabel
<nameOfDualSelector>_rightButton
<nameOfDualSelector>_rightAllButton
<nameOfDualSelector>_leftButton
<nameOfDualSelector>_leftAllButton
<nameOfDualSelector>_upButton
<nameOfDualSelector>_downButton
<nameOfDualSelector>_submitButton

See Also:
DualListSelector, TreeListSelector, DualTreeSelector, TreeView, ListBox, Serialized Form

Field Summary
static java.lang.String RB_KEY
          The RB_KEY for internationalization
 
Fields inherited from class com.sas.servlet.tbeans.dualselector.BaseDualSelector
imageLocation
 
Fields inherited from interface com.sas.servlet.tbeans.dualselector.html.DualSelectorStyleKeysInterface
DUALSELECTOR_BUTTON, DUALSELECTOR_CONTAINER, DUALSELECTOR_SOURCE_CONTAINER, DUALSELECTOR_SOURCE_LABEL_AREA, DUALSELECTOR_SOURCE_LISTBOX, DUALSELECTOR_TARGET_CONTAINER, DUALSELECTOR_TARGET_LABEL_AREA, DUALSELECTOR_TARGET_LISTBOX
 
Fields inherited from interface com.sas.servlet.tbeans.dualselector.DualSelectorKeysInterface
DUALSELECTOR, DUALSELECTOR_DOWN_BUTTON, DUALSELECTOR_LEFT_ALL_BUTTON, DUALSELECTOR_LEFT_BUTTON, DUALSELECTOR_RIGHT_ALL_BUTTON, DUALSELECTOR_RIGHT_BUTTON, DUALSELECTOR_SOURCE, DUALSELECTOR_SOURCE_LABEL, DUALSELECTOR_SUBMIT_BUTTON, DUALSELECTOR_TARGET, DUALSELECTOR_TARGET_LABEL, DUALSELECTOR_UP_BUTTON
 
Constructor Summary
DualSelector()
          Constructor
DualSelector(java.lang.String name)
          Constructor
 
Method Summary
 java.util.HashMap getAdditionalParameters()
          Returns an HashMap containing additional parameters that should be added to the form used to perform the various actions on the tbean.
protected  BaseButton getDefaultButton()
          Returns a default button used for this dual selector.
protected  java.lang.String getDefaultButtonTemplate()
           
 Form getDefaultFormObject()
          Gets the default form object to be used by the DualListSelector.
protected  BaseLabel getDefaultLabel()
          Returns the default label used for the target and source components.
protected  java.lang.String getDefaultMoveButtonTemplate()
           
protected  java.lang.String getDefaultMoveUpDownButtonTemplate()
           
protected  java.lang.String getDefaultSelectorTemplate()
           
 java.lang.String getDefaultTemplate()
          Returns the default template used for this selector
 Form getFormObject()
          Gets the form object to be used by the DualListSelector.
protected abstract  java.lang.String getMoveAllToTarget()
          Returns the JavaScript function name for moving all items from the source component to the target.
protected abstract  java.lang.String getMoveItemsDown()
          Returns the JavaScript function name for moving item(s) down on the target component.
protected abstract  java.lang.String getMoveItemsUp()
          Returns the JavaScript function name for moving item(s) up on the target component.
protected abstract  java.lang.String getMoveToTarget()
          Returns the JavaScript function name for moving item(s) from the source component to the target.
 java.lang.String getPostDownTrigger()
          Returns a name of JavaScript function name which will be executed after an item is moved down in the target component.
 java.lang.String getPostSourceTrigger()
          Returns a name of JavaScript function name which will be executed after an item is moved from the target to the source list.
 java.lang.String getPostTargetTrigger()
          Returns a name of JavaScript function name which will be executed after an item is moved from the source to the target list.
 java.lang.String getPostUpTrigger()
          Returns a name of JavaScript function name which will be executed after an item is moved up in the target component.
 java.lang.String getPreDownTrigger()
          Returns a name of JavaScript function name which will be executed before an item is moved down in the target component.
 java.lang.String getPreSourceTrigger()
          Sets a JavaScript function name which will be executed before an item is moved from target to source.
 java.lang.String getPreTargetTrigger()
          Returns a name of JavaScript function name which will be executed before an item is moved from the source to the target list.
 java.lang.String getPreUpTrigger()
          Returns a name of JavaScript function name which will be executed before an item is moved up in the target component.
protected abstract  java.lang.String getRemoveAllFromTarget()
          Returns the JavaScript function name for removing all items from the target component.
protected abstract  java.lang.String getRemoveFromTarget()
          Returns the JavaScript function name for removing item(s) from the target component.
protected  java.lang.String getSourceComponentName()
          Returns the name of the source component
protected abstract  java.lang.String getSubmitAction()
          Returns the JavaScript function name for submitting the form
protected  java.lang.String getTargetComponentName()
          Returns the name of the target component
 void initializeSelector()
           
 boolean isFormEnabled()
          Determines if the tbean should render its formObject.
 void setAdditionalParameter(java.lang.String name, java.lang.String value)
          Sets an additional parameter to be added to the form used to perform the various actions on the TableView.
 void setAdditionalParameters(java.util.HashMap map)
          Sets an HashMap containing additional parameters that should be added to the form used to perform the various actions on the tbean.
protected  void setDefaultComponentNames()
          Sets default names for the components that are in this DualSelector.
 void setFormEnabled(boolean value)
          Sets whether the tbean should render its formObject.
 void setFormObject(Form form)
          Sets the form object to be used by the DualListSelector.
 void setId(java.lang.String value)
          Sets the id of the component.
 void setName(java.lang.String value)
          Deprecated. Use setId() method.
 void setPostDownTrigger(java.lang.String value)
          Sets a JavaScript function name which will be executed after an item is moved down in the target component.
 void setPostSourceTrigger(java.lang.String value)
          Sets a function name which will be executed after an item is moved from target to source.
 void setPostTargetTrigger(java.lang.String value)
          Sets a JavaScript function name which will be executed after an item is moved from source to target.
 void setPostUpTrigger(java.lang.String value)
          Sets a JavaScript function name which will be executed after an item is moved up in the target component.
 void setPreDownTrigger(java.lang.String value)
          Sets a JavaScript function name which will be executed before an item is moved down in the target component.
 void setPreSourceTrigger(java.lang.String value)
          Sets a JavaScript function name which will be executed before an item is moved from target to source.
 void setPreTargetTrigger(java.lang.String value)
          Sets a JavaScript function name which will be executed before an item is moved from source to target.
 void setPreUpTrigger(java.lang.String value)
          Sets a JavaScript function name which will be executed before an item is moved up in the target component.
protected  void setSelectorDefaults()
          Sets default images, and JavaScript events for the components.
 
Methods inherited from class com.sas.servlet.tbeans.dualselector.BaseDualSelector
getImageLocation, getMultipleSelections, getSize, getSourceLabel, getTargetLabel, getTargetMaximumCount, isStaticSourceAllowed, isSubmitButtonVisible, isTargetButtonsVisible, isTargetDuplicateAllowed, isTransferAllButtonVisible, setImageLocation, setMultipleSelections, setSize, setStaticSourceAllowed, setSubmitButtonVisible, setTargetButtonsVisible, setTargetDuplicateAllowed, setTargetMaximumCount, setTransferAllButtonVisible
 
Methods inherited from class com.sas.servlet.tbeans.BaseCompositeTransformation
applyTemplate, applyTemplate, getActionProvider, getComponent, getComponents, getStyleInfo, getStyleMap, getTemplate, getTemplateDictionary, getTemplateFileName, getTemplateLocation, getVisibleComponents, isFlushEnabled, propertyChange, removeComponent, setActionProvider, setCleanUpResourcesOn, setComponent, setFlushEnabled, setLocale, setRequest, setResponse, setStyleInfo, setTemplate, setTemplate, setTemplateDictionary, setTemplateFileName, setTemplateLocation, write, writeTemplate
 
Methods inherited from class com.sas.servlet.tbeans.BaseTransformation
addPropertyChangeListener, addPropertyChangeListener, cleanUpResources, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCustomAttributes, getDescription, getId, getInputTransform, getLocale, getName, getObjectData, getObjectDataProperty, getOutputTransform, getRequest, getResponse, getTagEpilog, getTagProlog, hasListeners, isCleanUpResourcesOn, isVisible, removePropertyChangeListener, removePropertyChangeListener, setCustomAttributes, setInputTransform, setLocaleDependentProperties, setObjectData, setObjectDataProperty, setOutputTransform, setTagEpilog, setTagProlog, setVisible, toString, write, write, write
 
Methods inherited from interface com.sas.actionprovider.HttpActionProviderInterface
getRequest
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
The RB_KEY for internationalization

See Also:
Constant Field Values
Constructor Detail

DualSelector

public DualSelector()
Constructor


DualSelector

public DualSelector(java.lang.String name)
Constructor

Parameters:
name - The field name
Method Detail

getRemoveFromTarget

protected abstract java.lang.String getRemoveFromTarget()
Returns the JavaScript function name for removing item(s) from the target component.

Returns:
JavaScript function name

getRemoveAllFromTarget

protected abstract java.lang.String getRemoveAllFromTarget()
Returns the JavaScript function name for removing all items from the target component.

Returns:
JavaScript function name

getMoveToTarget

protected abstract java.lang.String getMoveToTarget()
Returns the JavaScript function name for moving item(s) from the source component to the target.

Returns:
JavaScript function name

getMoveItemsUp

protected abstract java.lang.String getMoveItemsUp()
Returns the JavaScript function name for moving item(s) up on the target component.

Returns:
JavaScript function name

getMoveItemsDown

protected abstract java.lang.String getMoveItemsDown()
Returns the JavaScript function name for moving item(s) down on the target component.

Returns:
JavaScript function name

getMoveAllToTarget

protected abstract java.lang.String getMoveAllToTarget()
Returns the JavaScript function name for moving all items from the source component to the target.

Returns:
JavaScript function name

getSubmitAction

protected abstract java.lang.String getSubmitAction()
Returns the JavaScript function name for submitting the form

Returns:
JavaScript function name

setSelectorDefaults

protected void setSelectorDefaults()
Sets default images, and JavaScript events for the components.


setDefaultComponentNames

protected void setDefaultComponentNames()
Sets default names for the components that are in this DualSelector.


setPostSourceTrigger

public void setPostSourceTrigger(java.lang.String value)
Sets a function name which will be executed after an item is moved from target to source.

Parameters:
value - The postSourceTrigger function name.
See Also:
getPostSourceTrigger()

getPostSourceTrigger

public java.lang.String getPostSourceTrigger()
Returns a name of JavaScript function name which will be executed after an item is moved from the target to the source list.

Returns:
The postSourceTrigger function name.
See Also:
setPostSourceTrigger(String)

setPreSourceTrigger

public void setPreSourceTrigger(java.lang.String value)
Sets a JavaScript function name which will be executed before an item is moved from target to source. The function must return true or false. If it returns false; the move will not occur.

See Also:
getPreSourceTrigger()

getPreSourceTrigger

public java.lang.String getPreSourceTrigger()
Sets a JavaScript function name which will be executed before an item is moved from target to source. The function must return true or false. If it returns false; the move will not occur.

Returns:
The preSourceTrigger function name.
See Also:
setPreSourceTrigger(String)

getPostTargetTrigger

public java.lang.String getPostTargetTrigger()
Returns a name of JavaScript function name which will be executed after an item is moved from the source to the target list.

Returns:
The postTargetTrigger function name.
See Also:
setPostTargetTrigger(String)

setPostTargetTrigger

public void setPostTargetTrigger(java.lang.String value)
Sets a JavaScript function name which will be executed after an item is moved from source to target.

Parameters:
value - The postTargetTrigger function name.

getPreTargetTrigger

public java.lang.String getPreTargetTrigger()
Returns a name of JavaScript function name which will be executed before an item is moved from the source to the target list.

Returns:
The preTargetTrigger function name.

setPreTargetTrigger

public void setPreTargetTrigger(java.lang.String value)
Sets a JavaScript function name which will be executed before an item is moved from source to target. The function must return true or false. If it returns false; the move will not occur.

Parameters:
value - The preTargetTrigger function name.

getPostUpTrigger

public java.lang.String getPostUpTrigger()
Returns a name of JavaScript function name which will be executed after an item is moved up in the target component.

Returns:
The postTargetTrigger function name.
See Also:
setPostUpTrigger(String)

setPostUpTrigger

public void setPostUpTrigger(java.lang.String value)
Sets a JavaScript function name which will be executed after an item is moved up in the target component.

Parameters:
value - The postTargetTrigger function name.

getPreUpTrigger

public java.lang.String getPreUpTrigger()
Returns a name of JavaScript function name which will be executed before an item is moved up in the target component. the source to the target list.

Returns:
The preTargetTrigger function name.

setPreUpTrigger

public void setPreUpTrigger(java.lang.String value)
Sets a JavaScript function name which will be executed before an item is moved up in the target component. The function must return true or false. If it returns false; the move will not occur.

Parameters:
value - The preTargetTrigger function name.

getPostDownTrigger

public java.lang.String getPostDownTrigger()
Returns a name of JavaScript function name which will be executed after an item is moved down in the target component.

Returns:
The postTargetTrigger function name.
See Also:
setPostDownTrigger(String)

setPostDownTrigger

public void setPostDownTrigger(java.lang.String value)
Sets a JavaScript function name which will be executed after an item is moved down in the target component.

Parameters:
value - The postTargetTrigger function name.

getPreDownTrigger

public java.lang.String getPreDownTrigger()
Returns a name of JavaScript function name which will be executed before an item is moved down in the target component.

Returns:
The preTargetTrigger function name.

setPreDownTrigger

public void setPreDownTrigger(java.lang.String value)
Sets a JavaScript function name which will be executed before an item is moved down in the target component. The function must return true or false. If it returns false; the move will not occur.

Parameters:
value - The preTargetTrigger function name.

setFormObject

public void setFormObject(Form form)
Sets the form object to be used by the DualListSelector.

Specified by:
setFormObject in interface FormViewInterface
Parameters:
form - the form object
See Also:
getFormObject()

getFormObject

public Form getFormObject()
Gets the form object to be used by the DualListSelector.

Specified by:
getFormObject in interface FormViewInterface
Returns:
the form object
See Also:
setFormObject(Form)

getDefaultFormObject

public Form getDefaultFormObject()
Gets the default form object to be used by the DualListSelector.

Specified by:
getDefaultFormObject in interface FormViewInterface
Returns:
the form object

getAdditionalParameters

public java.util.HashMap getAdditionalParameters()
Returns an HashMap containing additional parameters that should be added to the form used to perform the various actions on the tbean. The default value is null. Each parameter will be added to the form as a hidden field using the name of the item as the name= parameter on the <input> tag and the value of the item as the value= parameter on the input tag.

Specified by:
getAdditionalParameters in interface FormViewInterface
Returns:
an HashMap containing additional parameters that should be added to the form
See Also:
HashMap

setAdditionalParameters

public void setAdditionalParameters(java.util.HashMap map)
Sets an HashMap containing additional parameters that should be added to the form used to perform the various actions on the tbean. The default value is null. Each parameter will be added to the form as a hidden field using the name of the item as the name= parameter on the <input> tag and the value of the item as the value= parameter on the input tag.

Specified by:
setAdditionalParameters in interface FormViewInterface
Parameters:
map - HashMap object
See Also:
HashMap

setAdditionalParameter

public void setAdditionalParameter(java.lang.String name,
                                   java.lang.String value)
Sets an additional parameter to be added to the form used to perform the various actions on the TableView. Each parameter will be added to the form as a hidden field using the name of the item as the name= parameter on the <input> tag and the value of the item as the value= parameter on the input tag.

Specified by:
setAdditionalParameter in interface FormViewInterface
Parameters:
name - name of the list item
value - value of the list item
See Also:
HashMap

isFormEnabled

public boolean isFormEnabled()
Determines if the tbean should render its formObject. If true, then the tbean is responsible for rendering the formObject via the formObject's writeHeader and writeFooter methods. If false then the tbean does not render the formObject and the user is responsible for rendering the formObject.

Specified by:
isFormEnabled in interface FormViewInterface
Returns:
true if the tbean should render its formObject

setFormEnabled

public void setFormEnabled(boolean value)
Sets whether the tbean should render its formObject. If so, then set to true. If set to false, the the user is responsible for rendering the formObject via its writeHeader and writeFooter methods.

Specified by:
setFormEnabled in interface FormViewInterface
Parameters:
value - true if the formObject should be rendered by the tbean

getDefaultButton

protected BaseButton getDefaultButton()
Description copied from class: BaseDualSelector
Returns a default button used for this dual selector.

Specified by:
getDefaultButton in class BaseDualSelector
Returns:
default button

getDefaultLabel

protected BaseLabel getDefaultLabel()
Description copied from class: BaseDualSelector
Returns the default label used for the target and source components.

Specified by:
getDefaultLabel in class BaseDualSelector
Returns:
default label

getDefaultMoveButtonTemplate

protected java.lang.String getDefaultMoveButtonTemplate()

getDefaultMoveUpDownButtonTemplate

protected java.lang.String getDefaultMoveUpDownButtonTemplate()

getDefaultButtonTemplate

protected java.lang.String getDefaultButtonTemplate()

getDefaultSelectorTemplate

protected java.lang.String getDefaultSelectorTemplate()

getDefaultTemplate

public java.lang.String getDefaultTemplate()
Returns the default template used for this selector

Specified by:
getDefaultTemplate in interface TemplateInterface
Overrides:
getDefaultTemplate in class BaseCompositeTransformation
Returns:
default template

getSourceComponentName

protected java.lang.String getSourceComponentName()
Returns the name of the source component

Returns:
name

getTargetComponentName

protected java.lang.String getTargetComponentName()
Returns the name of the target component

Returns:
name

setName

public void setName(java.lang.String value)
Deprecated. Use setId() method.

Sets the name of the component. The sub-components will be named based on the new name set

Specified by:
setName in interface TransformationInterface
Overrides:
setName in class BaseTransformation
Parameters:
value - The name of the component
See Also:
setId(String)

setId

public void setId(java.lang.String value)
Sets the id of the component. The sub-components will be id will be named based on the new id set

Specified by:
setId in interface TransformationInterface
Overrides:
setId in class BaseCompositeTransformation
Parameters:
value - The id of the component

initializeSelector

public void initializeSelector()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.