Code permit to extend table feature in order to manage exception not managed by property. In code there are ready-to-use event-driven method (server side), but it is also possible to develop additional ones for custom need.
Table event are:

beforeEdit(e){}
managed “Before start to edit” a record. Usually used for check edit condition.
Parameter:

e.getTable() : table or sub-table event is refered to.

In case of conditions to edit are not verified, developer can show an user error via:

throw new dataweb.datastore.DataStoreException(<ErrorMessage>);

Where <ErrorMessage> is string error to show.

afterEdit(e){}
managed “after start to edit”.
Parameter:

e.getTable() : table or sub-table event is refered to.

beforeAddNew(e){}
managed “before to start insert operation” of a new record. Used for check insert condition.
Parameter:

e.getTable() : table or sub-table event is refered to.

In case of conditions to addNew are not verified, developer can show an user error via:

throw new dataweb.datastore.DataStoreException(<ErrorMessage>);

Where <ErrorMessage> is string error to show.

afterAddNew(e){}
Managed when “start adding of a new record ”.
Parameter:

e.getTable() : table or sub-table event is refered to.

beforeSetValue(e){}
Managed “before to set a value” into a column record. Used for check set conditions.
Parameter

e.getTable() : table or sub-table event is refered to.       
e.getColumnName() : column name.
e.getValue() : value is going to be set.

In case of conditions to set value are not verified, developer can show an user error via:

throw new dataweb.datastore.DataStoreException(<ErrorMessage>);

Where <ErrorMessage> is string error to show.

afterSetValue(e){}
Managed “after set a value” into a column record.
Parameter:

e.getTable() : table or sub-table event is refered to.       
e.getColumnName() : column name.
e.getValue() : value is set to.

beforeUpdate(e){}
Managed “before to store record in table”. Used for check record condition.
Parameter:

e.getTable() : table or sub-table event is refered to.       

In case of conditions to store record are not verified, developer can show an user error via:

throw new dataweb.datastore.DataStoreException(<ErrorMessage>);

Where <ErrorMessage> is string error to show.

afterUpdate(e){}
Managed after “store a record” in table.
Parameter:

e.getTable() : table or sub-table event is refered to.

In order to read/write data out from table structure but keeping operation integrity, some additional event that run when data are phisically written into DB are present. So in those cases we can perform operation on other tables in same transaction.
Those event are:

beforeBeginTransaction(e){}
IManaged before a transaction start.
Parameter:

e.getTable() : table or sub-table event is refered to.

afterBeginTransaction(e){}
Managed when transaction start.
Parameter:

e.getTable() : table or sub-table event is refered to.
e.getTransaction() : transaction context

beforeInsertTransaction(e){}
Managed before to insert a row into DB.
Parameter:

e.getTable() : table or sub-table event is refered to.
e.getTransaction() : transaction context
e.getValues(): array is going to be stored into DB.
e.getValue(<ColName>) :  <ColName> value. This value is going to be     stored into DB.
e.setValue(<ColName>,<Value>) :change the <ColName> value to     <Value> value before to store record into DB.
e.setValue(<IdxCol>,<Value>) : change the <IdxCol> value to <Value>     value before to store record into DB.

afterInsertTransaction(e){}
Managed after stored record into DB.
Parameter:

e.getTable() : table or sub-table event is refered to.
e.getTransaction() : transaction context
e.getValues(): array is going to be stored into DB.
e.getValue(<ColName>) :  <ColName> value stored into DB.

beforeUpdateTransaction(e){}
Managed before to store a record into DB
Parameter:

e.getTable() : table or sub-table event is refered to.
e.getTransaction() : transaction context
e.getOldValues() : array of values were stored into Record.
e.getOldValue(<ColName>) : <ColName> value was stored into record
e.getValues() : array of values is going to be stored into DB.
e.getValue(<ColName>) : <ColName> value is going to store into DB.
isChangedColumn(<ColName>) : if   <ColName> column value is     changed
e.setValue(<ColName>,<Value>) : change the  <ColName> value to    <Value> value before to store data into DB.
e.setValue(<IdxCol>,<Value>) : change the <IdxCol> value to <Value>     value before to store into DB.

afterUpdateTransaction(e){}
Managed after update a record into DB.
Parameter:

e.getTable() : table or sub-table event is refered to.
e.getTransaction() : transaction context
e.getOldValues() : array of values were stored into Record.
e.getOldValue(<ColName>) : <ColName> value was stored into record
e.getValues() : array of values store into DB.
e.getValue(<ColName>) : <ColName> value store into DB.
isChangedColumn(<ColName>) : if  <ColName> column has been     modified

beforeDeleteTransaction(e){}
Managed before to delete a record from DB.
Parameter:

e.getTable() : table or sub-table event is refered to.
e.getTransaction() : transaction context
e.getValues(): array is going to delete from DB.
e.getValue(<ColName>) :  <ColName> value. This value is going to be     delete into DB.

afterDeleteTransaction(e){}
Managed after delete a record from DB.
Parameter:

e.getTable() : table or sub-table event is refered to.
e.getTransaction() : transaction context
e.getValues() : array of values just delete from DB.
e.getValue(<ColName>) :  <ColName> value just delete from DB.

beforeCommitTransaction(e){}
Managed before all change done into transaction are going to be stored into DB.
Parameter:

e.getTable() : table or sub-table event is refered to.
e.getTransaction() : transaction context

afterCommitTransaction(e){}

Managed after all change done into transaction are going to be stored into DB.
Parameter:

e.getTable() : table or sub-table event is refered to.

beforeRoolbackTransaction(e){}
Managed before to RollBack all change of a transaction.
Parameter

e.getTable() : table or sub-table event is refered to.
e.getTransaction() : transaction context

afterRoolbackTransaction(e){}
Managed after to RollBack all change of a transaction.
Parameter

e.getTable() : table or sub-table event is refered to.

Last updatedFriday, 19 November 2010 23:21