Main Page | Packages | Class Tree | Index | Help

xp.data

class ItemDataSource

Object
  |
  +--xp.system.DispatcherObject
        |
        +--xp.data.ItemDataSource

Implemented Interfaces: IDataSource
All Known Subclasses: DataSource

class ItemDataSource
extends DispatcherObject

DataSource objects lets you work with data.

ItemDataSource encapsulates a single data object exposed though the currentItem property.
SubClasses like DataSource lets you manipulate the data item through insert, update and delete.
SubClasses like ListDataSource lets you work with data as collections of objects.
A ItemDataSource can be bound to the currentItem of another IDataSource to create simple master/detail relationships.
A DataSource is somewhat similar to a DataHolder.

Event summary for the ItemDataSource class
The following table lists events of the ItemDataSource class.


EventTypeDescription
xp.events.ModelChangedEventmodeChangedBroadcast when the data model changes.
xp.events.EventloadBroadcast after the data item has loaded.


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Field Summary

public static
classInfo: Object
A static class information object

public
dataSourceBinding: Object
The collection of bindings

public
id: String
The name of this datasource

public
name: String
The name of this datasource

public
readOnly: Boolean
Controls whether the datasource is read only

Fields inherited from class xp.system.DispatcherObject

parent

Property Summary

public
currentItem: Object (read-only)
Get the current data item encapsulated by this datasource

public
data: Object (read, write)
Get or set the data object encapsulated by this datasource

public
isEmpty: Boolean (read-only)
Returns true if this datasource contains data

public
length: Number (read-only)
The number of records in the datasource

Constructor

public
ItemDataSource ( dataItem: Object)
Create a new instance

Method Summary

public
addBinding ( bind: Object, isDataBound: Boolean ): Object
Add a binding to this control

public
getBinding ( property: String ): Object
Returns the binding object for a given property

public
getClass ( ): Function
Returns a reference to the components static class

public
refresh ( ): Void
Refresh the data

public
updateViews ( eventName: String ): Void
Dispatches the modelChanged event to all listeners

Methods inherited from class xp.system.DispatcherObject

addEventListener, removeEventListener, routeEvent



Field Documentation

classInfo

public static var classInfo: Object
A static class information object

Every class has an associated classInfo object that holds the version and other static information. The classInfo can be accessed either directly by referencing the static class or by calling getClass() on any class instance.

dataSourceBinding

public var dataSourceBinding: Object
The collection of bindings

id

public var id: String
The name of this datasource

name

public var name: String
The name of this datasource

readOnly

public var readOnly: Boolean
Controls whether the datasource is read only


Property Documentation

currentItem

public currentItem: Object (read-only)
Get the current data item encapsulated by this datasource

data

public data: Object (read, write)
Get or set the data object encapsulated by this datasource

isEmpty

public isEmpty: Boolean (read-only)
Returns true if this datasource contains data

length

public length: Number (read-only)
The number of records in the datasource


Constructor Documentation

ItemDataSource

public function ItemDataSource(dataItem: Object)
Create a new instance

Parameters:
dataItem
The data object to be encapsulated by this DataSource

Method Documentation

addBinding

public function addBinding(bind: Object,
 isDataBound: Boolean): Object
Add a binding to this control

Parameters:
bind
The bind descriptor
isDataBound
Is this a DataBinding binding defaults to true.

getBinding

public function getBinding(property: String): Object
Returns the binding object for a given property

Parameters:
property
The bound property
Returns:
The binding object

getClass

public function getClass(): Function
Returns a reference to the components static class

refresh

public function refresh(): Void
Refresh the data

Not implemented in the base class, we dont know how to refresh ourselves.

updateViews

public function updateViews(eventName: String): Void
Dispatches the modelChanged event to all listeners

Parameters:
eventName
A string that describes the change that took place.

The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc