***  This class is subject to change.  ***

com.sas.servlet.tbeans.html
Class ListEditor

com.sas.servlet.tbeans.html.ListEditor
All Implemented Interfaces:
HttpActionProviderInterface, com.sas.beans.PropertyChangeSource, com.sas.lang.ObjectDataInterface, com.sas.servlet.tbeans.AJAXControllerURLInterface, BaseListEditorKeysInterface, ComplexStyleInterface, CompositeComponentInterface, ListEditorStyleKeysInterface, RenderableInterface, TemplateInterface, com.sas.servlet.tbeans.TemplateKeyInterface, TransformationInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable

public class ListEditor
implements ListEditorStyleKeysInterface

The ListEditor is a TransformationBean™ that generates the appropriate HTML 4.0 and JavaScript to represent an editable list of items. A ListEditor consists of a list of items and list management buttons. List management takes the form of "Add", "Update", "Delete", and "Delete All" functions. The Add button should add an item to the list. Update should modify an existing item (likely the selected item). Delete should delete the selected item (or items if the list allows multiple selection). Finally, Delete All should eliminate all items in the list.

You can use ListEditor beans in a Java servlet or in a JSP scriplet. The ListEditor requires a javax.swing.ListModel for its model.

Most of the properties used for a ListEditor are inherited from BaseListEditor

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

sas_ListEditor.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.

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 .

Since:
3.1
See Also:
BaseListEditor, ListModel, Serialized Form

Field Summary
protected  java.lang.String confirmDelAllMsg
          The message to display in the confirmation box when all entries are to be deleted.
protected  java.lang.String confirmDeleteMsg
          The message to display in the confirmation box when an entry is to be deleted.
static java.lang.String DEFAULT_TEMPLATE_FILE_NAME
          The default composite template filename.
static java.lang.String RB_KEY
          The prefix used for resource properties associated with this class.
 
Fields inherited from class com.sas.servlet.tbeans.BaseListEditor
postAddTrigger, postDeleteAllTrigger, postDeleteTrigger, postSelectTrigger, postUpdateTrigger, preAddTrigger, preDeleteAllTrigger, preDeleteTrigger, preSelectTrigger, preUpdateTrigger
 
Fields inherited from interface com.sas.servlet.tbeans.html.ListEditorStyleKeysInterface
LISTEDITOR_ADD_BUTTON_CONTAINER, LISTEDITOR_BUTTON_CONTAINER, LISTEDITOR_CONTAINER, LISTEDITOR_DELETE_BUTTON_CONTAINER, LISTEDITOR_DELETEALL_BUTTON_CONTAINER, LISTEDITOR_LIST_CONTAINER, LISTEDITOR_UPDATE_BUTTON_CONTAINER
 
Fields inherited from interface com.sas.servlet.tbeans.BaseListEditorKeysInterface
LISTEDITOR_ADD_BUTTON, LISTEDITOR_BODY, LISTEDITOR_DELETE_BUTTON, LISTEDITOR_DELETEALL_BUTTON, LISTEDITOR_LIST, LISTEDITOR_UPDATE_BUTTON
 
Constructor Summary
ListEditor()
          Constructs a new ListEditor component with the default properties.
ListEditor(java.lang.String name)
          Constructs a new ListEditor component with the given name.
 
Method Summary
protected  java.lang.String getAddButtonOnClick()
          Constructs and returns the JavaScript code for the "OnClick" event for the "Add" button.
 java.lang.String getConfirmDeleteAllMessage()
          Returns the current "all entries deletion" confirmation message text.
 java.lang.String getConfirmDeleteMessage()
          Returns the current "selected entry deletion" confirmation message text.
 BaseButton getDefaultAddButton()
          Constructs and returns a new default "Add" button component.
 java.lang.String getDefaultConfirmDeleteAllMessage()
          Returns the default "all entries deletion" confirmation message text.
 java.lang.String getDefaultConfirmDeleteMessage()
          Returns the default "selected entry deletion" confirmation message text.
 BaseButton getDefaultDeleteAllButton()
          Constructs and returns a new default "Delete All" button component.
 BaseButton getDefaultDeleteButton()
          Constructs and returns a new default "Delete" button component.
 BaseListBox getDefaultListComponent()
          Constructs and returns a new default list component.
 BaseButton getDefaultUpdateButton()
          Constructs and returns a new default "Update" button component.
protected  java.lang.String getDeleteAllButtonOnClick()
          Constructs and returns the JavaScript code for the "OnClick" event for the "Delete All" button.
protected  java.lang.String getDeleteButtonOnClick()
          Constructs and returns the JavaScript code for the "OnClick" event for the "Delete" button.
protected  java.lang.String getJavaScript()
          Constructs and returns the JavaScript code for this component.
protected  java.lang.String getJavaScriptName()
          Returns the name of this component as referred to in any JavaScript code.
protected  java.lang.String getListComponentOnChange()
          Constructs and returns the JavaScript code for the "OnChange" event for the list component.
 java.util.Map getStyleMap()
          Returns the active style map.
protected  java.lang.String getUpdateButtonOnClick()
          Constructs and returns the JavaScript code for the "OnClick" event for the "Update" button.
 void setConfirmDeleteAllMessage(java.lang.String value)
          Sets the "all entries deletion" confirmation message text.
 void setConfirmDeleteMessage(java.lang.String value)
          Sets the "selected entry deletion" confirmation message text.
 void setId(java.lang.String id)
          Sets the id for this ListEditor component.
protected  void setLocaleDependentProperties(java.util.Locale locale)
          Sets or refreshes any locale dependent properties.
 void setName(java.lang.String name)
          Deprecated. Use setId
 void setRequest(javax.servlet.http.HttpServletRequest request)
          Sets the request object for this tbean.
 void write(java.io.PrintWriter out)
          Constructs the HTML code for this tbean and sends it to the given output.
 
Methods inherited from class com.sas.servlet.tbeans.BaseListEditor
getAddButton, getDeleteAllButton, getDeleteButton, getListComponent, getModel, getPostAddTrigger, getPostDeleteAllTrigger, getPostDeleteTrigger, getPostSelectTrigger, getPostUpdateTrigger, getPreAddTrigger, getPreDeleteAllTrigger, getPreDeleteTrigger, getPreSelectTrigger, getPreUpdateTrigger, getUpdateButton, isAddButtonVisible, isDeleteAllButtonVisible, isDeleteButtonVisible, isUpdateButtonVisible, setAddButtonVisible, setDeleteAllButtonVisible, setDeleteButtonVisible, setDynamicButtonArea, setModel, setPostAddTrigger, setPostDeleteAllTrigger, setPostDeleteTrigger, setPostSelectTrigger, setPostUpdateTrigger, setPreAddTrigger, setPreDeleteAllTrigger, setPreDeleteTrigger, setPreSelectTrigger, setPreUpdateTrigger, setUpdateButtonVisible
 
Methods inherited from class com.sas.servlet.tbeans.BaseCompositeTransformation
applyTemplate, applyTemplate, getActionProvider, getComponent, getComponents, getDefaultTemplate, getStyleInfo, getTemplate, getTemplateDictionary, getTemplateFileName, getTemplateLocation, getVisibleComponents, isFlushEnabled, propertyChange, removeComponent, setActionProvider, setCleanUpResourcesOn, setComponent, setFlushEnabled, setLocale, setResponse, setStyleInfo, setTemplate, setTemplate, setTemplateDictionary, setTemplateFileName, setTemplateLocation, 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, 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 prefix used for resource properties associated with this class.

See Also:
Constant Field Values

DEFAULT_TEMPLATE_FILE_NAME

public static final java.lang.String DEFAULT_TEMPLATE_FILE_NAME
The default composite template filename.

See Also:
Constant Field Values

confirmDeleteMsg

protected java.lang.String confirmDeleteMsg
The message to display in the confirmation box when an entry is to be deleted.


confirmDelAllMsg

protected java.lang.String confirmDelAllMsg
The message to display in the confirmation box when all entries are to be deleted.

Constructor Detail

ListEditor

public ListEditor()
Constructs a new ListEditor component with the default properties.


ListEditor

public ListEditor(java.lang.String name)
Constructs a new ListEditor component with the given name.

Parameters:
name - the name for the new tbean
Method Detail

setLocaleDependentProperties

protected void setLocaleDependentProperties(java.util.Locale locale)
Sets or refreshes any locale dependent properties.

Overrides:
setLocaleDependentProperties in class BaseTransformation
Parameters:
locale - the locale to use

getStyleMap

public java.util.Map getStyleMap()
Returns the active style map.

Specified by:
getStyleMap in interface ComplexStyleInterface
Overrides:
getStyleMap in class BaseCompositeTransformation
Returns:
the style map

getDefaultListComponent

public BaseListBox getDefaultListComponent()
Constructs and returns a new default list component.

Specified by:
getDefaultListComponent in class BaseListEditor
Returns:
the default list component

getDefaultAddButton

public BaseButton getDefaultAddButton()
Constructs and returns a new default "Add" button component.

Specified by:
getDefaultAddButton in class BaseListEditor
Returns:
the default "Add" button

getDefaultUpdateButton

public BaseButton getDefaultUpdateButton()
Constructs and returns a new default "Update" button component.

Specified by:
getDefaultUpdateButton in class BaseListEditor
Returns:
the default "Update" button

getDefaultDeleteButton

public BaseButton getDefaultDeleteButton()
Constructs and returns a new default "Delete" button component.

Specified by:
getDefaultDeleteButton in class BaseListEditor
Returns:
the default "Delete" button

getDefaultDeleteAllButton

public BaseButton getDefaultDeleteAllButton()
Constructs and returns a new default "Delete All" button component.

Specified by:
getDefaultDeleteAllButton in class BaseListEditor
Returns:
the default "Delete All" button

setId

public void setId(java.lang.String id)
Sets the id for this ListEditor component. The new id is applied to the child components.

Specified by:
setId in interface TransformationInterface
Overrides:
setId in class BaseCompositeTransformation
Parameters:
id - the new id for this component

setName

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

Sets the name for this ListEditor component. The new name is applied to the child components.

Specified by:
setName in interface TransformationInterface
Overrides:
setName in class BaseTransformation
Parameters:
name - the new name for this component
See Also:
BaseTransformation.setId(java.lang.String)

getListComponentOnChange

protected java.lang.String getListComponentOnChange()
Constructs and returns the JavaScript code for the "OnChange" event for the list component.

Returns:
the list component's "OnChange" event code

getAddButtonOnClick

protected java.lang.String getAddButtonOnClick()
Constructs and returns the JavaScript code for the "OnClick" event for the "Add" button.

Returns:
the "Add" button's "OnClick" event code

getUpdateButtonOnClick

protected java.lang.String getUpdateButtonOnClick()
Constructs and returns the JavaScript code for the "OnClick" event for the "Update" button.

Returns:
the "Update" button's "OnClick" event code

getDeleteButtonOnClick

protected java.lang.String getDeleteButtonOnClick()
Constructs and returns the JavaScript code for the "OnClick" event for the "Delete" button.

Returns:
the "Delete" button's "OnClick" event code

getDeleteAllButtonOnClick

protected java.lang.String getDeleteAllButtonOnClick()
Constructs and returns the JavaScript code for the "OnClick" event for the "Delete All" button.

Returns:
the "Delete All" button's "OnClick" event code

getDefaultConfirmDeleteMessage

public java.lang.String getDefaultConfirmDeleteMessage()
Returns the default "selected entry deletion" confirmation message text.

Returns:
the default confirmation message

getDefaultConfirmDeleteAllMessage

public java.lang.String getDefaultConfirmDeleteAllMessage()
Returns the default "all entries deletion" confirmation message text.

Returns:
the default confirmation message

getConfirmDeleteMessage

public java.lang.String getConfirmDeleteMessage()
Returns the current "selected entry deletion" confirmation message text.

Returns:
the current confirmation message

getConfirmDeleteAllMessage

public java.lang.String getConfirmDeleteAllMessage()
Returns the current "all entries deletion" confirmation message text.

Returns:
the current confirmation message

setConfirmDeleteMessage

public void setConfirmDeleteMessage(java.lang.String value)
Sets the "selected entry deletion" confirmation message text.

Parameters:
value - the new confirmation message

setConfirmDeleteAllMessage

public void setConfirmDeleteAllMessage(java.lang.String value)
Sets the "all entries deletion" confirmation message text.

Parameters:
value - the new confirmation message

write

public void write(java.io.PrintWriter out)
           throws java.io.IOException
Constructs the HTML code for this tbean and sends it to the given output.

Specified by:
write in interface TransformationInterface
Specified by:
write in interface com.sas.util.WriteToPrintWriterInterface
Overrides:
write in class BaseCompositeTransformation
Parameters:
out - the output to write the HTML code to
Throws:
java.io.IOException - if any errors occur while processing the output

getJavaScriptName

protected java.lang.String getJavaScriptName()
Returns the name of this component as referred to in any JavaScript code.

Returns:
the JavaScript name for this component

getJavaScript

protected java.lang.String getJavaScript()
Constructs and returns the JavaScript code for this component.

Returns:
the component's JavaScript

setRequest

public void setRequest(javax.servlet.http.HttpServletRequest request)
Sets the request object for this tbean.

Specified by:
setRequest in interface HttpActionProviderInterface
Specified by:
setRequest in interface TransformationInterface
Overrides:
setRequest in class BaseCompositeTransformation
Parameters:
request - the new request
See Also:
HttpActionProviderInterface.getRequest()

***  This class is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.