[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/Web/UI/WebControls/ -> TListControl.php (sommaire)

TListControl class file

Author: Qiang Xue <qiang.xue@gmail.com>
Copyright: Copyright © 2005 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Id: TListControl.php 1397 2006-09-07 07:55:53Z wei $
Poids: 894 lignes (26 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

TListItemCollection:: (8 méthodes):
  createListItem()
  insertAt()
  findIndexByValue()
  findIndexByText()
  findItemByValue()
  findItemByText()
  loadState()
  saveState()

Définit 8 fonctions

  getTagName()
  addAttributesToRender()
  getClientClassName()
  getPostBackOptions()
  addParsedObject()
  performDataBinding()
  resetCachedSelections()
  createListItemCollection()
  saveState()
  loadState()
  getIsMultiSelect()
  getAppendDataBoundItems()
  setAppendDataBoundItems()
  getAutoPostBack()
  setAutoPostBack()
  getCausesValidation()
  setCausesValidation()
  getDataTextField()
  setDataTextField()
  getDataTextFormatString()
  setDataTextFormatString()
  getDataValueField()
  setDataValueField()
  getDataGroupField()
  setDataGroupField()
  getItemCount()
  getHasItems()
  getItems()
  getSelectedIndex()
  setSelectedIndex()
  getSelectedIndices()
  setSelectedIndices()
  getSelectedItem()
  getSelectedValue()
  setSelectedValue()
  getSelectedValues()
  setSelectedValues()
  getText()
  setText()
  clearSelection()
  getValidationGroup()
  setValidationGroup()
  onSelectedIndexChanged()
  onTextChanged()
  renderContents()
  formatDataValue()

Classe: TListItemCollection  - X-Ref

TListItemCollection class.

TListItemCollection maintains a list of {@link TListItem} for {@link TListControl}.

createListItem($index=-1)   X-Ref
Creates a list item object.
This method may be overriden to provide a customized list item object.

param: integer index where the newly created item is to be inserted at.
return: TListItem list item object

insertAt($index,$item)   X-Ref
Inserts an item into the collection.

param: integer the location where the item will be inserted.
param: TListItem the item to be inserted.

findIndexByValue($value,$includeDisabled=true)   X-Ref
Finds the lowest cardinal index of the item whose value is the one being looked for.

param: string the value to be looked for
param: boolean whether to look for disabled items also
return: integer the index of the item found, -1 if not found.

findIndexByText($text,$includeDisabled=true)   X-Ref
Finds the lowest cardinal index of the item whose text is the one being looked for.

param: string the text to be looked for
param: boolean whether to look for disabled items also
return: integer the index of the item found, -1 if not found.

findItemByValue($value,$includeDisabled=true)   X-Ref
Finds the item whose value is the one being looked for.

param: string the value to be looked for
param: boolean whether to look for disabled items also
return: TListItem the item found, null if not found.

findItemByText($text,$includeDisabled=true)   X-Ref
Finds the item whose text is the one being looked for.

param: string the text to be looked for
param: boolean whether to look for disabled items also
return: TListItem the item found, null if not found.

loadState($state)   X-Ref
Loads state into every item in the collection.
This method should only be used by framework and control developers.

param: array|null state to be loaded.

saveState()   X-Ref
Saves state of items.
This method should only be used by framework and control developers.

return: array|null the saved state

Fonctions
Fonctions qui ne font pas partie d'une Classe:

getTagName()   X-Ref

return: string tag name of the list control

addAttributesToRender($writer)   X-Ref
Adds attributes to renderer.

param: THtmlWriter the renderer

getClientClassName()   X-Ref
Gets the name of the javascript class responsible for performing postback for this control.
Derived classes may override this method and return customized js class names.

return: string the javascript class name

getPostBackOptions()   X-Ref

return: array postback options for JS postback code

addParsedObject($object)   X-Ref
Adds object parsed from template to the control.
This method adds only {@link TListItem} objects into the {@link getItems Items} collection.
All other objects are ignored.

param: mixed object parsed from template

performDataBinding($data)   X-Ref
Performs databinding to populate list items from data source.
This method is invoked by dataBind().
You may override this function to provide your own way of data population.

param: Traversable the data

resetCachedSelections()   X-Ref
Pas de description

createListItemCollection()   X-Ref
Creates a collection object to hold list items.
This method may be overriden to create a customized collection.

return: TListItemCollection the collection object

saveState()   X-Ref
Saves items into viewstate.
This method is invoked right before control state is to be saved.


loadState()   X-Ref
Loads items from viewstate.
This method is invoked right after control state is loaded.


getIsMultiSelect()   X-Ref

return: boolean whether this is a multiselect control. Defaults to false.

getAppendDataBoundItems()   X-Ref

return: boolean whether performing databind should append items or clear the existing ones. Defaults to false.

setAppendDataBoundItems($value)   X-Ref

param: boolean whether performing databind should append items or clear the existing ones.

getAutoPostBack()   X-Ref

return: boolean a value indicating whether an automatic postback to the server

setAutoPostBack($value)   X-Ref
Sets the value indicating if postback automatically.
An automatic postback to the server will occur whenever the user
makes change to the list control and then tabs out of it.

param: boolean the value indicating if postback automatically

getCausesValidation()   X-Ref

return: boolean whether postback event trigger by this list control will cause input validation, default is true.

setCausesValidation($value)   X-Ref

param: boolean whether postback event trigger by this list control will cause input validation.

getDataTextField()   X-Ref

return: string the field of the data source that provides the text content of the list items.

setDataTextField($value)   X-Ref

param: string the field of the data source that provides the text content of the list items.

getDataTextFormatString()   X-Ref

return: string the formatting string used to control how data bound to the list control is displayed.

setDataTextFormatString($value)   X-Ref
Sets data text format string.
The format string is used in {@link TDataValueFormatter::format()} to format the Text property value
of each item in the list control.

param: string the formatting string used to control how data bound to the list control is displayed.

getDataValueField()   X-Ref

return: string the field of the data source that provides the value of each list item.

setDataValueField($value)   X-Ref

param: string the field of the data source that provides the value of each list item.

getDataGroupField()   X-Ref

return: string the field of the data source that provides the label of the list item groups

setDataGroupField($value)   X-Ref

param: string the field of the data source that provides the label of the list item groups

getItemCount()   X-Ref

return: integer the number of items in the list control

getHasItems()   X-Ref

return: boolean whether the list control contains any items.

getItems()   X-Ref

return: TListItemCollection the item collection

getSelectedIndex()   X-Ref

return: integer the index (zero-based) of the item being selected, -1 if no item is selected.

setSelectedIndex($index)   X-Ref

param: integer the index (zero-based) of the item to be selected

getSelectedIndices()   X-Ref

return: array list of index of items that are selected

setSelectedIndices($indices)   X-Ref

param: array list of index of items to be selected

getSelectedItem()   X-Ref

return: TListItem|null the selected item with the lowest cardinal index, null if no item is selected.

getSelectedValue()   X-Ref

return: string the value of the selected item with the lowest cardinal index, empty if no selection

setSelectedValue($value)   X-Ref
Sets selection by item value.
Existing selections will be cleared if the item value is found in the item collection.
Note, if the value is null, existing selections will also be cleared.

param: string the value of the item to be selected.

getSelectedValues()   X-Ref

return: array list of the selected item values (strings)

setSelectedValues($values)   X-Ref

param: array list of the selected item values

getText()   X-Ref

return: string selected value

setText($value)   X-Ref

param: string value to be selected

clearSelection()   X-Ref
Clears all existing selections.


getValidationGroup()   X-Ref

return: string the group of validators which the list control causes validation upon postback

setValidationGroup($value)   X-Ref

param: string the group of validators which the list control causes validation upon postback

onSelectedIndexChanged($param)   X-Ref
Raises OnSelectedIndexChanged event when selection is changed.
This method is invoked when the list control has its selection changed
by end-users.

param: TEventParameter event parameter

onTextChanged($param)   X-Ref
Raises OnTextChanged event when selection is changed.
This method is invoked when the list control has its selection changed
by end-users.

param: TEventParameter event parameter

renderContents($writer)   X-Ref
Renders body content of the list control.
This method renders items contained in the list control as the body content.

param: THtmlWriter writer

formatDataValue($formatString,$value)   X-Ref
Formats the text value according to a format string.
If the format string is empty, the original value is converted into
a string and returned.
If the format string starts with '#', the string is treated as a PHP expression
within which the token '{0}' is translated with the data value to be formated.
Otherwise, the format string and the data value are passed
as the first and second parameters in {@link sprintf}.

param: string format string
param: mixed the data to be formatted
return: string the formatted result



Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7