ListItemsCollection V1.0 F1.7


File Name: Server_ASPListItemCollection.asp OR ASPFramework.ListItemsCollection
Class Name: Always use New_ListItemsCollectionObject() which will wrap the appropriate implementation (depending on the mode: ASP or COM)

Overview
Used to wrap a XML representation of collection of ListItems, each having with a Text, Value and Selected properties. The collection supportes single and multiple selections. This class is currenly used by the Server_DropDown, Server_CheckBoxList and Server_RadioButton



Public Constructors

New_ListItemsCollectionObject() Default constructor and is used to wrap the real implementation.

Public Properties
GetSelectedValue Variant Returns the value of the selected item.
GetSelectedText Variant Returns the text of the selected item.
Mode Int 0 = Single Selection (Default) 1 = Multiple Selection
Count Int Gets the number of Items in the collection

Public Methods
SetState(xml) Sets the xml for the collection. This is used by the Sever Controls to restore the collection in from the viewstate (or any other source).
GetState Gets the xml from collection. This is used by the Sever Controls to persist the collection to the viewstate
GetValue(index) Gets the value of the item at position <index>.
GetText(index) Gets the text of the item at position <index>.
IsSelected(index) Returns true if the selected flag of the item at the position <index> is = -1 (true).
IsSelectedByText(Text) Returns true if the selected flag of the item with text <text>  is = -1 (true).
IsSelectedByValue(value) Returns true if the selected flag of the item with value <value>  is = -1 (true).
GetItemData(ByVal index , ByRef Text , ByRef value , ByRef selected ) Gets all the properties of the item specified at position <index>.
SetValue(index,value ) Sets the value of the item at position <index>
SetText(index,value ) Sets the text of the item at position <index>
SetSelected(index,bolSelected ) Sets the selected attribute of the item with value <value>
SetSelectedByText(Text, bolSelected ) Sets the selected attribute of the item with text <text>
SetSelectedByValue(Value,bolSelected ) Sets the selected attribute of the item with value <value>
SetAllSelected(bolSelected ) Sets selected attribute of all the items.
Clear Removes all the items.
Add(ByVal Text , ByVal value , ByVal selected , ByVal index) Adds a new item. If index >0 then  item will be inserted after position at <index>.
Append(ByVal Text , ByVal value , ByVal selected) Appends a new item to the collection.
Remove(index) Removes item at position <index>

Public Events
-- --

Protected Properties
-- -- --

Protected Methods
GetItemByValue(value) Gets the xml node with value = <value>, if any.
GetItemByText(text) Gets the xml node with text = <text>, if any.

Protected Events
-- --