~~Title: DataBook Events~~ The IDataBook Iinterface defines the possible events that can occur while using DataBooks. These events are triggered on different occasions. The following instructions show the possible event triggers and the exact event sequence. ===== Triggers ===== ==== Saving Records ==== {{:jvx:client:model:databook:saveselectedrow.png?nolink|}} ==== Discarding Changes ==== {{:jvx:client:model:databook:restoreselectedrow.png?nolink|}} ==== Inserting Records ==== {{:jvx:client:model:databook:insert.png?nolink|}} ==== Editing Records ==== {{:jvx:client:model:databook:update.png?nolink|}} {{:jvx:client:model:databook:setvalue.png?nolink|}} ==== Deleting Records ==== {{:jvx:client:model:databook:delete.png?nolink|}} ==== Row Change ==== {{:jvx:client:model:databook:setselectedrow.png?nolink|}} ==== Column Change ==== {{:jvx:client:model:databook:setselectedcolumn.png?nolink|}} ==== Updating Data ==== {{:jvx:client:model:databook:reload.png?nolink|}} ==== Row Change in Master ==== {{:jvx:client:model:databook:masterchanged.png?nolink|}} \\ ====== Examples ====== ==== Insert ==== ^Event^Description^ |BEFORE INSERTING| * Change current selection, e.g., to always insert in the first or last row * Throw exception to prevent insertion | |AFTER INSERTING|Set default values| |BEFORE INSERTED| * Input-independent change of values * If writeback is deactivated, a server action can be called to perform the insertion | |AFTER INSERTED|Process server-tier data| ==== Update ==== ^Event^Description^ |BEFORE UPDATING|Manual locking| |AFTER UPDATING|Control visibility or en-/disable components. For example, when editing is not permitted| |BEFORE UPDATED| * Calculate dynamic columns and copy values into writeback columns * If writeback is deactivated, a server action can be called to perform the update | |AFTER UPDATED|Process server-tier data| ==== Delete ==== ^Event^Description^ |BEFORE DELETING| * Throw exception to prevent deletion * Delete prompt. For this purpose, the Isolation Level is set to DATA_SOURCE and a dialogue is displayed. Upon confirmation, saveSelectedRow() is called and the Isolation Level is reset. If cancelled, restoreSelectedRow() is called and the Isolation Level is reset. | |AFTER DELETING|Call saveSelectedRow() at the DATA_SOURCE Isolation Level| |BEFORE DELETED|If writeback is deactivated, a server action can be called to perform the deletion| |AFTER DELETED|Calculate sums| ==== Restore ==== ^Event^Description^ |BEFORE RESTORE|Throw exception to NOT discard changes| |AFTER RESTORE|Update GUI/status| ==== Value Changed ==== ^Event^Description^ |VALUE CHANGED| * Change dependent values * Reset the changed value * Save row after each value change | ==== Row Selected ==== ^Event^Description^ |BEFORE ROW SELECTED|Throw exception to prevent leaving the row| |AFTER ROW SELECTED|Control visibility or en-/disable components after a row change| ==== Column Selected ==== ^Event^Description^ |BEFORE COLUMN SELECTED |Throw exception to prevent leaving the column| |AFTER COLUMN SELECTED|Control visibility or en-/disable components after a column change|