com.plumtree.uiinfrastructure.expandablelist
Class ExpListModel

java.lang.Object
  extended by com.plumtree.uiinfrastructure.editor.EditorHelperModel
      extended by com.plumtree.uiinfrastructure.expandablelist.ExpListModel
All Implemented Interfaces:
IManagedObject, IModel, IModelRO, IMVCObject, IExpListModelRO, IPaginationModel, IPaginationModelRO
Direct Known Subclasses:
AutomationServerListModel, CollabExpListModel, ExpListPropModel, GbDocTypeExtListModel, GbDocTypeListModel, GrowableListModel, InvCodesListModel, KeywordsModel, LockboxListModel, LocNamesModel, MainActivityRightsListModel, MigrationDependencyListModel, MigrationSelectForImportModel, MultiColumnListModel, MyCommunitiesListModel, ObjPropMapPluginModel, PageListModel, PropChooserModel, PTMultiColumnListModel, SelectActivityRightsModel, SelectPTObjectModel, SiteMapPortletPrefsSortedLinksModel, TemplateListModel, UserLockListModel

public abstract class ExpListModel
extends EditorHelperModel
implements IExpListModelRO, IPaginationModel

This class contains the state of the Expandable List. The data contained in that Model are printed out by the associated View: ExpListView. The repost actions will be handled by the ExpListControl class. That class extends the Editor Framework plug-in section classes so it can be added to any Editor page pretty easily. (see template 7) The Expandable List Framework is abstract and has to be extended in order to be used. Note that the Expandable List uses the Array Wrapper Framework to actually store the data and facilitate the implementation of the sorting requirements.

Author:
Julie Fournier

Field Summary
static int EXPLIST_COLUMN_COLSPAN
          Colspan for the HTML cell.
static int EXPLIST_COLUMN_ENABLESORT
          Flag to know if the link to sort by that column should be enabled.
static int EXPLIST_COLUMN_ID
          Key (as an Integer) to get back the column ID from m_arrExpListColInfo
static int EXPLIST_COLUMN_INVALID
          MES- Flag to know how many flags there are- how many columns
static int EXPLIST_COLUMN_TITLE
          Key (as a String) to get back the column title from m_arrExpListColInfo
static int EXPLIST_COLUMN_WIDTH
          Key (as a String) to get back the column width from m_arrExpListColInfo
static int EXPLIST_SORTEDARRAY_PROPID_INDEX
          We are defining here a column ID for the Growable Sorted Array objects.
protected  java.lang.Object[][] m_arrExpListColInfo
          Array of column titles, associated column IDs and column width
protected  boolean m_bAddButtonDisabled
          DCA - Variable to show add button or not.
protected  boolean m_bCheckBoxesDisabled
          DCA - Variable to show check boxes or not.
protected  boolean m_bEnableMoveRowActions
          Set this flag to true if you want to display the move up and down buttons at the end of each row.
protected  boolean m_bIsReadOnly
          Special mode to have a read-only expandable list: all actions are hidden.
protected  boolean m_bWrapColumnHeaders
          JF- Wrap attribute for the column headers
protected  PTImageType m_imgAddIcon
          The add icon.
protected  PTImageType m_imgDeleteIcon
          The delete icon.
protected  int m_nListKey
          This key is used when there is more than one expandable list on the same Display Page.
 int m_nNextIndex
          To keep track of the next available index.
protected  PTGrowableSortedArrayWrapper m_saData
          This is where we store the data displayed on the list.
protected  java.lang.String m_sAddIconAlt
          Alt text for the add icon.
protected  java.lang.String m_sAddLabel
          Text to display next to the add icon.
protected  java.lang.String m_sDeleteIconAlt
          Alt text for the delete icon.
protected  java.lang.String m_sDelRowConfirmMsg
          JF- COnfirmation message to display when the user deletes a row.
protected  java.lang.String m_sEmptyListAlert
          Message to display as a JavaScript alert if the list is empty.
protected  java.lang.String m_sInstructions
          Instructions to display when the list is empty.
protected  java.lang.String m_sMainMessage
          Main message to display when the list is empty (in red).
protected  java.lang.String m_sSectionTitle
          The section main title.
protected  java.lang.String m_sTableInstructions
          JF- List instructions.
static int MAX_ROWS
          Max number of items per page.
static int MOVEACTION_DOWN
          Will move the corresponding item one row down.
static int MOVEACTION_FIRST
          Will move the corresponding item to the top of the list.
static int MOVEACTION_LAST
          Will move the corres ponding item to the bottom of the list.
static int MOVEACTION_UP
          Will move the corresponding item one row up.
protected  AActivitySpace parent
          Associated AS class
 
Fields inherited from class com.plumtree.uiinfrastructure.editor.EditorHelperModel
m_asOwner
 
Constructor Summary
ExpListModel()
           
 
Method Summary
abstract  void AddRowsOnRepost(XPHashtable _htFormData)
          Will be called each time the add action is performed.
 void DeleteRowsOnRepost(XPHashtable _htFormData)
          Gets the array of checked rows and delete them from the list.
 void DisableAddButton()
          DCA - Choose not to display add button
 void DisableCheckBoxes()
          DCA - Disable check boxes.
 void EnablePagination(java.lang.String _sModelStorageName)
          Enables the pagination.
 PTImageType GetAddIcon()
          Returns icon for the add action.
 java.lang.String GetAddIconAlt()
          Returns the alt text for the add icon.
 java.lang.String GetAddLabel()
          Returns the String to display next to the add icon.
 java.lang.String GetAlertMessageForEmptyList()
          Returns the message to display by the JavaScript when the list is empty.
 int[] GetArrayOfObjToDelete(XPHashtable _htFormData)
          ROB: Make the available for other models.
 java.lang.Object[][] GetArrExpListColInfo()
          Returns the array of column titles, associated column IDs and column width.
 int GetCurrentLowerObjectCount()
          This method returns the current lower count for which objects to display.
 int GetCurrentUpperObjectCount()
          This method returns the current upper count for which objects to display.
 PTImageType GetDeleteIcon()
          Returns icon for the delete action.
 java.lang.String GetDeleteIconAlt()
          Returns the alt text for the delete icon.
 java.lang.String GetDelRowConfirmMsg()
          JF- Returns the confirmation message to display when the user tries to delete a row.
 java.lang.String GetEmptyListInstructions()
          Returns the secondary String to display when the String is empty.
 java.lang.String GetEmptyListMainMessage()
          Returns the main String to diplay when the list is empty.
 boolean GetEnableMoveRowActions()
          Returns true if the move up and down buttons should be displayed.
 boolean GetIsListReadOnly()
          Returns the value of the m_bIsReadOnly member variable.
 PTGrowableSortedArrayWrapper GetItems()
          Returns the array of data.
 int GetListKey()
          Returns the key of the expandable list.
 int GetMainColumnSort()
          Returns the column ID of the primary sorted column.
 int GetMainColumnSortDirection()
          Returns the sort direction of the primary sorted column.
 java.lang.String GetModelStorageName()
          Returns the storage key of this Model.
protected  int GetMoveAction(XPHashtable _htFormData)
          Helper method to retrieve the move action type from the form data.
 int GetNumObjects()
          This method returns the total number of objects available for display.
 int GetPaginationSize()
          This is the number of objects displayed per page.
 IPTGrowableSortedArrayWrapperRO GetReadOnlyItems()
          Returns a read-only interface of the data.
protected  int GetRowIndex(XPHashtable _htFormData)
          Helper method to retrieve the row index from the form data.
 java.lang.String GetSectionTitle()
          Returns the section title.
 java.lang.String GetTableInstructions()
          JF- Returns table intructions
 int GetUniqueInt(int _nValue)
          Creates dynamically a unique int and returns it.
 java.lang.String GetUniqueString(java.lang.String _sName)
          Creates dynamically a unique name with the list key and returns it.
 XPSortedDictionary GetUnusedProperties()
           
 boolean GetWrapColumnHeaders()
          JF- Returns the wrap attribute for the column headers.
 void InitializeExpandableList(java.lang.String _sSectionTitle, java.lang.Object[][] _arrExpListColInfo, PTImageType _imgAddIcon, java.lang.String _sAddLabel, int _nListKey)
          Initializes the expandable list.
 void InitializeReadOnlyExpandableList(java.lang.String _sSectionTitle, java.lang.Object[][] _arrExpListColInfo, int _nListKey)
          Initializes the read-only expandable list.
abstract  void InitializeSortedArray(PTGrowableSortedArrayWrapper _saData)
          Will be called when this class is initalized.
 boolean IsAddButtonDisabled()
          DCA - Check if add button is to be displayed
 boolean IsCheckBoxesDisabled()
          DCA - Check to see if check boxes has been disabled.
 boolean IsPaginationEnabled()
          Returns true if the pagination is enabled for this expandable list.
 void ModifyRow(XPHashtable _htFormData)
          Action for modifying a row
protected  void MoveDown(int _nRowIndex)
          Moves the row identified by the index in argument, one row down.
protected  void MoveFirst(int _nRowIndex)
          Moves the row identified by the index in argument, to the top of the list.
protected  void MoveLast(int _nRowIndex)
          Moves the row identified by the index in argument, to the last position of the list.
 void MoveRow(XPHashtable _htFormData)
          Gets the row index back and the move action back.
protected  void MoveUp(int _nRowIndex)
          Moves the row identified by the index in argument, one row up.
 void ReverseCurrentSort()
          Reverses the sort of the primary sorted column.
protected abstract  int SaveRow(PTGrowableSortedArrayWrapper _saData, int _nRowIndex, XPHashtable _htFormData)
          Will be called each ime there is a repost to save the data on the list.
 int SaveSection(XPHashtable _htFormData)
          Saves the data when a repost occurs.
 void SetAddIcon(PTImageType _imgAddIcon)
          The delete icon will be set by default to add.gif.
 void SetAddIconAlt(java.lang.String _sAddIconAlt)
          Sets the value of the alt text for the add icon.
 void SetDeleteIcon(PTImageType _imgDeleteIcon)
          The delete icon will be set by default to delete.gif.
 void SetDeleteIconAlt(java.lang.String _sDeleteIconAlt)
          Sets the value of the alt text for the delete icon.
 void SetDelRowConfirmMsg(java.lang.String _sDelRowConfirmMsg)
          JF- Sets the confirmation message to display when the user tried to delete a row.
 void SetEmptyListMessages(java.lang.String _sMainMessage, java.lang.String _sInstructions)
          Sets messages to display when the list is empty.
 java.lang.String SetEnableEmptyListClientValidation(java.lang.String _sEmptyListAlert)
          Enable the JavaScript validation to ensure that the list is not empty.
 void SetEnableMoveRowActions(boolean _bEnableMoveRowActions)
          Set this flag to true if you want to display the move up and down buttons at the end of each row.
 void SetIsListReadOnly(boolean _bIsReadOnly)
          Changes the value of the m_bIsReadOnly member variable.
 void SetListKey(int _nListKey)
          Sets a new value for this list key.
 void SetPagination(int nPaginationID, int nPaginationLowerBound, int nPaginationUpperBound)
          This is used by the PaginationControl to set which objects should be displayed.
 void SetSectionTitle(java.lang.String _sSectionTitle)
          Sets the section title.
 void SetTableInstructions(java.lang.String _sTableInstructions)
          JF- Sets table intructions.
 void SetWrapColumnHeaders(boolean _bWrapColumnHeaders)
          JF- Sets the wrap cell attribute for the column headers.
 void SortByColumn(XPHashtable _htFormData)
          Gets the column ID back from the form data and resort the array by that column ID, ascending.
 
Methods inherited from class com.plumtree.uiinfrastructure.editor.EditorHelperModel
CleanupAllData, CleanupTempData, Create, GetName, Init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IModel
CleanupAllData, CleanupTempData, Init
 
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IManagedObject
Create
 
Methods inherited from interface com.plumtree.uiinfrastructure.activityspace.IMVCObject
GetName
 

Field Detail

EXPLIST_COLUMN_ID

public static final int EXPLIST_COLUMN_ID
Key (as an Integer) to get back the column ID from m_arrExpListColInfo

See Also:
Constant Field Values

EXPLIST_COLUMN_TITLE

public static final int EXPLIST_COLUMN_TITLE
Key (as a String) to get back the column title from m_arrExpListColInfo

See Also:
Constant Field Values

EXPLIST_COLUMN_WIDTH

public static final int EXPLIST_COLUMN_WIDTH
Key (as a String) to get back the column width from m_arrExpListColInfo

See Also:
Constant Field Values

EXPLIST_COLUMN_COLSPAN

public static final int EXPLIST_COLUMN_COLSPAN
Colspan for the HTML cell.

See Also:
Constant Field Values

EXPLIST_COLUMN_ENABLESORT

public static final int EXPLIST_COLUMN_ENABLESORT
Flag to know if the link to sort by that column should be enabled.

See Also:
Constant Field Values

EXPLIST_COLUMN_INVALID

public static final int EXPLIST_COLUMN_INVALID
MES- Flag to know how many flags there are- how many columns

See Also:
Constant Field Values

EXPLIST_SORTEDARRAY_PROPID_INDEX

public static final int EXPLIST_SORTEDARRAY_PROPID_INDEX
We are defining here a column ID for the Growable Sorted Array objects. This column has to reflect the position of the row in the list. Methods to implement the move up, down, first and last actions are already implemented in this class and are ready to be used. However they will work only if the column ID below exists in the object array.

See Also:
Constant Field Values

MOVEACTION_FIRST

public static final int MOVEACTION_FIRST
Will move the corresponding item to the top of the list.

See Also:
Constant Field Values

MOVEACTION_UP

public static final int MOVEACTION_UP
Will move the corresponding item one row up.

See Also:
Constant Field Values

MOVEACTION_DOWN

public static final int MOVEACTION_DOWN
Will move the corresponding item one row down.

See Also:
Constant Field Values

MOVEACTION_LAST

public static final int MOVEACTION_LAST
Will move the corres ponding item to the bottom of the list.

See Also:
Constant Field Values

m_nNextIndex

public int m_nNextIndex
To keep track of the next available index. This index is incremented each time a row is added to the list.


parent

protected AActivitySpace parent
Associated AS class


m_saData

protected PTGrowableSortedArrayWrapper m_saData
This is where we store the data displayed on the list. We are taking advantage of the sorting features offered by the Array Wrapper framework.


m_bWrapColumnHeaders

protected boolean m_bWrapColumnHeaders
JF- Wrap attribute for the column headers


m_imgAddIcon

protected PTImageType m_imgAddIcon
The add icon.


m_imgDeleteIcon

protected PTImageType m_imgDeleteIcon
The delete icon.


m_sAddIconAlt

protected java.lang.String m_sAddIconAlt
Alt text for the add icon.


m_sAddLabel

protected java.lang.String m_sAddLabel
Text to display next to the add icon.


m_sDeleteIconAlt

protected java.lang.String m_sDeleteIconAlt
Alt text for the delete icon.


m_sEmptyListAlert

protected java.lang.String m_sEmptyListAlert
Message to display as a JavaScript alert if the list is empty.


m_sInstructions

protected java.lang.String m_sInstructions
Instructions to display when the list is empty.


m_sMainMessage

protected java.lang.String m_sMainMessage
Main message to display when the list is empty (in red).


m_sSectionTitle

protected java.lang.String m_sSectionTitle
The section main title.


m_arrExpListColInfo

protected java.lang.Object[][] m_arrExpListColInfo
Array of column titles, associated column IDs and column width


m_bAddButtonDisabled

protected boolean m_bAddButtonDisabled
DCA - Variable to show add button or not.


m_bCheckBoxesDisabled

protected boolean m_bCheckBoxesDisabled
DCA - Variable to show check boxes or not.


m_bEnableMoveRowActions

protected boolean m_bEnableMoveRowActions
Set this flag to true if you want to display the move up and down buttons at the end of each row. Warning: if this is set to true, then the sort by column will NOT be available anymore. You can't have both it doesn't make sense.


m_bIsReadOnly

protected boolean m_bIsReadOnly
Special mode to have a read-only expandable list: all actions are hidden.


m_sTableInstructions

protected java.lang.String m_sTableInstructions
JF- List instructions.


m_sDelRowConfirmMsg

protected java.lang.String m_sDelRowConfirmMsg
JF- COnfirmation message to display when the user deletes a row.


m_nListKey

protected int m_nListKey
This key is used when there is more than one expandable list on the same Display Page.


MAX_ROWS

public static final int MAX_ROWS
Max number of items per page.

See Also:
Constant Field Values
Constructor Detail

ExpListModel

public ExpListModel()
Method Detail

AddRowsOnRepost

public abstract void AddRowsOnRepost(XPHashtable _htFormData)
Will be called each time the add action is performed. Should take care of adding the row(s) to the list. Use the GetItems() method to get the list.

Parameters:
_htFormData - Form data

DeleteRowsOnRepost

public void DeleteRowsOnRepost(XPHashtable _htFormData)
Gets the array of checked rows and delete them from the list.

Parameters:
_htFormData -

DisableAddButton

public void DisableAddButton()
DCA - Choose not to display add button


DisableCheckBoxes

public void DisableCheckBoxes()
DCA - Disable check boxes.


SetWrapColumnHeaders

public void SetWrapColumnHeaders(boolean _bWrapColumnHeaders)
JF- Sets the wrap cell attribute for the column headers. Is true by default.

Parameters:
_bWrapColumnHeaders -

GetWrapColumnHeaders

public boolean GetWrapColumnHeaders()
JF- Returns the wrap attribute for the column headers.

Specified by:
GetWrapColumnHeaders in interface IExpListModelRO
Returns:
boolean
See Also:
GetWrapColumnHeaders()

GetTableInstructions

public java.lang.String GetTableInstructions()
JF- Returns table intructions

Specified by:
GetTableInstructions in interface IExpListModelRO
Returns:
String
See Also:
com.plumtree.uiinfrastructure.expandablelist.ExpListModel#GetTableIntructions()

SetTableInstructions

public void SetTableInstructions(java.lang.String _sTableInstructions)
JF- Sets table intructions.

Parameters:
_sTableInstructions -

GetDelRowConfirmMsg

public java.lang.String GetDelRowConfirmMsg()
JF- Returns the confirmation message to display when the user tries to delete a row.

Specified by:
GetDelRowConfirmMsg in interface IExpListModelRO
Returns:
String
See Also:
GetWrapColumnHeaders()

SetDelRowConfirmMsg

public void SetDelRowConfirmMsg(java.lang.String _sDelRowConfirmMsg)
JF- Sets the confirmation message to display when the user tried to delete a row.

Parameters:
m_sDelRowConfirmMsg -

GetAddIcon

public PTImageType GetAddIcon()
Returns icon for the add action.

Specified by:
GetAddIcon in interface IExpListModelRO
Returns:
PTImageType
See Also:
GetAddIcon()

GetAddIconAlt

public java.lang.String GetAddIconAlt()
Returns the alt text for the add icon.

Specified by:
GetAddIconAlt in interface IExpListModelRO
Returns:
String
See Also:
GetAddIconAlt()

GetAddLabel

public java.lang.String GetAddLabel()
Returns the String to display next to the add icon.

Specified by:
GetAddLabel in interface IExpListModelRO
Returns:
String
See Also:
GetAddLabel()

GetAlertMessageForEmptyList

public java.lang.String GetAlertMessageForEmptyList()
Returns the message to display by the JavaScript when the list is empty.

Specified by:
GetAlertMessageForEmptyList in interface IExpListModelRO
Returns:
String
See Also:
GetAlertMessageForEmptyList()

GetArrExpListColInfo

public java.lang.Object[][] GetArrExpListColInfo()
Returns the array of column titles, associated column IDs and column width.

Specified by:
GetArrExpListColInfo in interface IExpListModelRO
Returns:
Object[][]
See Also:
GetArrExpListColInfo()

GetArrayOfObjToDelete

public int[] GetArrayOfObjToDelete(XPHashtable _htFormData)
ROB: Make the available for other models.

Parameters:
_htFormData -
Returns:
int[]

GetDeleteIcon

public PTImageType GetDeleteIcon()
Returns icon for the delete action.

Specified by:
GetDeleteIcon in interface IExpListModelRO
Returns:
PTImageType
See Also:
GetDeleteIcon()

GetDeleteIconAlt

public java.lang.String GetDeleteIconAlt()
Returns the alt text for the delete icon.

Specified by:
GetDeleteIconAlt in interface IExpListModelRO
Returns:
String
See Also:
GetDeleteIconAlt()

GetEmptyListInstructions

public java.lang.String GetEmptyListInstructions()
Returns the secondary String to display when the String is empty. (Should give instructions to the user on what to do).

Specified by:
GetEmptyListInstructions in interface IExpListModelRO
Returns:
String
See Also:
GetEmptyListInstructions()

GetEmptyListMainMessage

public java.lang.String GetEmptyListMainMessage()
Returns the main String to diplay when the list is empty.

Specified by:
GetEmptyListMainMessage in interface IExpListModelRO
Returns:
String
See Also:
GetEmptyListMainMessage()

GetEnableMoveRowActions

public boolean GetEnableMoveRowActions()
Returns true if the move up and down buttons should be displayed. (use GetHTMLForMoveRowActions in ExpListView to dsiplay the HTMl on each row)

Specified by:
GetEnableMoveRowActions in interface IExpListModelRO
Returns:
boolean
See Also:
GetEnableMoveRowActions()

GetIsListReadOnly

public boolean GetIsListReadOnly()
Returns the value of the m_bIsReadOnly member variable. If this is true, the user will not be able to perform any action on the list.

Specified by:
GetIsListReadOnly in interface IExpListModelRO
Returns:
boolean
See Also:
com.plumtree.uiinfrastructure.expandablelist.ExpListModel#GetListAccessFlag()

GetItems

public PTGrowableSortedArrayWrapper GetItems()
Returns the array of data.

Returns:
PTGrowableSortedArrayWrapper

GetListKey

public int GetListKey()
Returns the key of the expandable list. (This key is used to avoid conflicts when there are multiple lists on the same page.)

Specified by:
GetListKey in interface IExpListModelRO
Returns:
int
See Also:
GetListKey()

SetListKey

public void SetListKey(int _nListKey)
Sets a new value for this list key.

Parameters:
_nListKey -

GetMainColumnSort

public int GetMainColumnSort()
Returns the column ID of the primary sorted column. (the array can be sorted by multiple columns)

Specified by:
GetMainColumnSort in interface IExpListModelRO
Returns:
int
See Also:
GetMainColumnSort()

GetMainColumnSortDirection

public int GetMainColumnSortDirection()
Returns the sort direction of the primary sorted column.

Specified by:
GetMainColumnSortDirection in interface IExpListModelRO
Returns:
int
See Also:
GetMainColumnSortDirection()

GetReadOnlyItems

public IPTGrowableSortedArrayWrapperRO GetReadOnlyItems()
Returns a read-only interface of the data.

Specified by:
GetReadOnlyItems in interface IExpListModelRO
Returns:
IPTGrowableSortedArrayWrapperRO
See Also:
GetReadOnlyItems()

GetSectionTitle

public java.lang.String GetSectionTitle()
Returns the section title.

Specified by:
GetSectionTitle in interface IExpListModelRO
Returns:
String
See Also:
GetSectionTitle()

GetUniqueInt

public int GetUniqueInt(int _nValue)
Creates dynamically a unique int and returns it. This method can be used for repost actions for example. This is to make sure that if there are more than one expandable list on the same dislpay page, there won't be any conflict between the two lists.

Specified by:
GetUniqueInt in interface IExpListModelRO
Parameters:
_nValue -
Returns:
int
See Also:
com.plumtree.uiinfrastructure.expandablelist.ExpListModel#GetUniqueInt()

GetUniqueString

public java.lang.String GetUniqueString(java.lang.String _sName)
Creates dynamically a unique name with the list key and returns it. This is to make sure that if there are more than one expandable list on the same dislpay page, there won't be any conflict between the two lists. This method should be used to create unique input names. It can also be used for JavaScript function names (other than postToSelf - for this one you just need to use the GetUniqueInt method to make sure your repost actions and other int values are unique).

Specified by:
GetUniqueString in interface IExpListModelRO
Parameters:
_sName -
Returns:
String
See Also:
com.plumtree.uiinfrastructure.expandablelist.ExpListModel#GetUniqueInputName()

InitializeExpandableList

public void InitializeExpandableList(java.lang.String _sSectionTitle,
                                     java.lang.Object[][] _arrExpListColInfo,
                                     PTImageType _imgAddIcon,
                                     java.lang.String _sAddLabel,
                                     int _nListKey)
Initializes the expandable list.

Parameters:
_sSectionTitle - Main title.
_arrExpListColInfo - Information about columns: title, ID and width.
_imgAddIcon - Icon for the add action.
_sAddLabel - Text to display next to the add icon.
_nListKey - In case you have multiple Expandable Lists on the same DP, they should have a different key (otherwise, just set it to 1).

InitializeReadOnlyExpandableList

public void InitializeReadOnlyExpandableList(java.lang.String _sSectionTitle,
                                             java.lang.Object[][] _arrExpListColInfo,
                                             int _nListKey)
Initializes the read-only expandable list.

Parameters:
_sSectionTitle - Main title.
_arrExpListColInfo - Information about columns: title, ID and width.
_nListKey - In case you have multiple Expandable Lists on the same DP, they should have a different key (otherwise, just set it to 1).

InitializeSortedArray

public abstract void InitializeSortedArray(PTGrowableSortedArrayWrapper _saData)
Will be called when this class is initalized. Should take care of initializing _saData (calling Initialize).

Parameters:
_saData -

IsAddButtonDisabled

public boolean IsAddButtonDisabled()
DCA - Check if add button is to be displayed

Specified by:
IsAddButtonDisabled in interface IExpListModelRO
See Also:
IsAddButtonDisabled()

IsCheckBoxesDisabled

public boolean IsCheckBoxesDisabled()
DCA - Check to see if check boxes has been disabled.

Specified by:
IsCheckBoxesDisabled in interface IExpListModelRO
Returns:
boolean
See Also:
IsCheckBoxesDisabled()

ModifyRow

public void ModifyRow(XPHashtable _htFormData)
Action for modifying a row

Parameters:
_htFormData -

MoveRow

public void MoveRow(XPHashtable _htFormData)
Gets the row index back and the move action back. Then perform the associated action.

Parameters:
_htFormData -

ReverseCurrentSort

public void ReverseCurrentSort()
Reverses the sort of the primary sorted column.


SaveSection

public int SaveSection(XPHashtable _htFormData)
Saves the data when a repost occurs. Editors using this framework need to call that method from the savePage method of the main Model.

Specified by:
SaveSection in class EditorHelperModel
Parameters:
_htFormData -
Returns:
int Status for server side validation

SetAddIcon

public void SetAddIcon(PTImageType _imgAddIcon)
The delete icon will be set by default to add.gif. Use that method if you want to change it.

Parameters:
__imgAddIcon -

SetAddIconAlt

public void SetAddIconAlt(java.lang.String _sAddIconAlt)
Sets the value of the alt text for the add icon. This is optional, by default this is set to empty String.

Parameters:
_sAddIconAlt -

SetDeleteIcon

public void SetDeleteIcon(PTImageType _imgDeleteIcon)
The delete icon will be set by default to delete.gif. Use that method if you want to change it.

Parameters:
_imgDeleteIcon -

SetDeleteIconAlt

public void SetDeleteIconAlt(java.lang.String _sDeleteIconAlt)
Sets the value of the alt text for the delete icon. This is optional, by default this is set to empty String.

Parameters:
_sDeleteIconAlt -

SetEmptyListMessages

public void SetEmptyListMessages(java.lang.String _sMainMessage,
                                 java.lang.String _sInstructions)
Sets messages to display when the list is empty.

Parameters:
_sMainMessage - Main message to display in red.
_sInstructions - Instructions on what to do.

SetEnableEmptyListClientValidation

public java.lang.String SetEnableEmptyListClientValidation(java.lang.String _sEmptyListAlert)
Enable the JavaScript validation to ensure that the list is not empty. The String in argument will be displayed by the JavaScript alert. And the String returned is the JavaScript name that should be registered for validation in the Editor. The name returned will be prefixed with the Expandable List key to avoid conflicts.

Parameters:
_sEmptyListAlert -
Returns:
String JavaScript function name

SetEnableMoveRowActions

public void SetEnableMoveRowActions(boolean _bEnableMoveRowActions)
Set this flag to true if you want to display the move up and down buttons at the end of each row. Warning: if this is set to true, then the sort by column will NOT be available anymore.

Parameters:
_bEnableMoveRowActions -

SetIsListReadOnly

public void SetIsListReadOnly(boolean _bIsReadOnly)
Changes the value of the m_bIsReadOnly member variable. If the list is read only, no action will be displayed in the action bar.

Parameters:
_bIsReadOnly -

SetSectionTitle

public void SetSectionTitle(java.lang.String _sSectionTitle)
Sets the section title.

Parameters:
_sSectionTitle -

SortByColumn

public void SortByColumn(XPHashtable _htFormData)
Gets the column ID back from the form data and resort the array by that column ID, ascending.

Parameters:
_htFormData -

GetMoveAction

protected int GetMoveAction(XPHashtable _htFormData)
Helper method to retrieve the move action type from the form data.

Parameters:
_htFormData -
Returns:
int

GetRowIndex

protected int GetRowIndex(XPHashtable _htFormData)
Helper method to retrieve the row index from the form data.

Parameters:
_htFormData -
Returns:
int

MoveDown

protected void MoveDown(int _nRowIndex)
Moves the row identified by the index in argument, one row down. The idea is that we are going to change the value of the index column. We just need to swap that value with the one of the row just after.

Parameters:
_nRowIndex - Index of the row to move.

MoveFirst

protected void MoveFirst(int _nRowIndex)
Moves the row identified by the index in argument, to the top of the list.

Parameters:
_nRowIndex - Index of the row to move.

MoveLast

protected void MoveLast(int _nRowIndex)
Moves the row identified by the index in argument, to the last position of the list.

Parameters:
_nRowIndex - Index of the row to move.

MoveUp

protected void MoveUp(int _nRowIndex)
Moves the row identified by the index in argument, one row up. The idea is that we are going to change the value of the index column. We just need to swap that value with the one of the previous row.

Parameters:
_nRowIndex - Index of the row to move.

SaveRow

protected abstract int SaveRow(PTGrowableSortedArrayWrapper _saData,
                               int _nRowIndex,
                               XPHashtable _htFormData)
Will be called each ime there is a repost to save the data on the list. Should contain the code to update the data on the row _nRowIndex.Use the SetItem method to update _saData and use _htFormData to retrieve the posted data.

Parameters:
_saData -
_nRowIndex -
_htFormData -
Returns:
int

SetPagination

public void SetPagination(int nPaginationID,
                          int nPaginationLowerBound,
                          int nPaginationUpperBound)
Description copied from interface: IPaginationModel
This is used by the PaginationControl to set which objects should be displayed.

Specified by:
SetPagination in interface IPaginationModel
Parameters:
nPaginationID - Unique ID of objects to paginate (usually class id) when there are multiple pagination sections per page.
nPaginationLowerBound - The starting count for objects to display
nPaginationUpperBound - The ending count for objects to display.
See Also:
com.plumtree.uiinfrastructure.form.pagination.IPaginationModel#SetPagination()

GetCurrentLowerObjectCount

public int GetCurrentLowerObjectCount()
Description copied from interface: IPaginationModelRO
This method returns the current lower count for which objects to display. This number is the 'n' in (Displaying n - m of o)

Specified by:
GetCurrentLowerObjectCount in interface IPaginationModelRO
Returns:
int the current lower count for which objects to display.
See Also:
IPaginationModelRO.GetCurrentLowerObjectCount()

GetCurrentUpperObjectCount

public int GetCurrentUpperObjectCount()
Description copied from interface: IPaginationModelRO
This method returns the current upper count for which objects to display. This number is the 'm' in (Displaying n - m of o)

Specified by:
GetCurrentUpperObjectCount in interface IPaginationModelRO
Returns:
int the current upper count for which objects to display.
See Also:
IPaginationModelRO.GetCurrentUpperObjectCount()

GetNumObjects

public int GetNumObjects()
Description copied from interface: IPaginationModelRO
This method returns the total number of objects available for display. This number is the 'o' in (Displaying n - m of o)

Specified by:
GetNumObjects in interface IPaginationModelRO
Returns:
int the total number of objects available for display.
See Also:
IPaginationModelRO.GetNumObjects()

GetPaginationSize

public int GetPaginationSize()
Description copied from interface: IPaginationModelRO
This is the number of objects displayed per page. This name is the value of (m - n)

Specified by:
GetPaginationSize in interface IPaginationModelRO
Returns:
int the total number of objects available for display per page
See Also:
IPaginationModelRO.GetPaginationSize()

GetModelStorageName

public java.lang.String GetModelStorageName()
Returns the storage key of this Model.

Specified by:
GetModelStorageName in interface IExpListModelRO
Returns:
String
See Also:
GetModelStorageName()

EnablePagination

public void EnablePagination(java.lang.String _sModelStorageName)
Enables the pagination.

Parameters:
_sModelStorageName - Storage name of the Expandable List Model.

IsPaginationEnabled

public boolean IsPaginationEnabled()
Returns true if the pagination is enabled for this expandable list.

Specified by:
IsPaginationEnabled in interface IExpListModelRO
Returns:
boolean
See Also:
IsPaginationEnabled()

GetUnusedProperties

public XPSortedDictionary GetUnusedProperties()
Specified by:
GetUnusedProperties in interface IExpListModelRO
Returns:



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.