eva/3 Application BuilderDeveloping Additional eva/3 ComponentsDevelopment of own data origins 

Practical use of the RecordSet

Filtering

In the most cases the filtering is activated by FormattedField, which set FilteredTableSource and FilteredControlSource. For all components refering at the TableElement which has to be filtered, HSRecordSetCondition were created and in the RecordSet by FormattedField HSRecordSetCondition were created and set in setRecordSetConditions(RecordSetCondition[] conditions).

After a change of a filter value a refresh() is disposed on the underlying RecordSet by the TableElement.
The refresh() method of the RecordSets can read this HSRecordSetCondition`s by getRecordSetConditions() and confine the amount.

Sorting

Usually the sorting is affected of the TableElement, or defined by the eventually used SScrollTable. At this for every sorting choice a RecordSetOrderCondition is generated and set in the RecordSet by setRecordSetOrderConditions(RecordSetOrderCondition[] conditions).
These can be rode and edit for example in the refresh() method of RecordSet by getRecordSetOrderConditions().

Positioning

At the positioning the cursor is placed on another sentence inside the available amount of data. Cusor means the actual selected row which has to be readable by getRow(). This stands at the Initialisation before the first dataset. Following methods are addressed.

Methode Aufgabe
previos() the cursor is moved one position down
next() the cursor is moved one position up
first() the cursor is moved at the first position
last() the cursor is moved at the last position
absolute(int i) the cursor is set at the commited row.
beforeFirst() the cursor is set before the first data set
afterLast() the cursor is set after the last data set
search(RecordSetCondition[] searchConditions) Positions the data set on the basis of the commited
RecordSetCondition`s. In this case it is no filtering,
but it is searched after the conditions within the amount of the result
and then the cursor is set at the first sentence.
At this it is no refresh() called. Mostly
the SearchedTableSource in the FormattedField
is responsible for this.
moveToInsertRow() Positions also after the last data set whereas
inserted should be set to true. This will be
explained in the next chapter.

Processing of data

At the processing of data should be worked with a extra cache for the actual row for making changes undoable.When an Object is updated setRowUpdated() should be set to true.

By the call of next() the changes of the actual row will be proofed. Is the property UpdateConfirm in the TableElement activated then a dialog asks for the storage.

Is this accept then a updateRow() will be called and the data of the cache have to be taken in the original stock.

The function insertRow() is called when isInserted() returns true. These has to be set by the user in moveToInsertRow(). moveToInsertRow() is called by eva/3 when it wants to create a new data set. isInserted() has to return true after the call of moveToInsertRow(). These can't return false until a data set is saved or the cursor has a new position.In the insert Mode (isInserted()) you should be attend to that getRowCount() returns one data set more.

Methodenaufgaben

Methode Aufgabe
getObject(int columnIndex) Returns the Object for the comitted column of the actual row.
updateObject(int columnIndex,Object x) Sets the Object for the commited column of the actual row. Here should be proved if the commited Object differs from
the set Object and then set setRowUpdated(true).
updateRow() Saves the changes of the actual row if isUpdated() is true
insertRow() Adds a new row if isUpdated() and isInserted() is true.
moveToInsertRow() Increases the row count temporary about 1 und positions at the last new row. Furthermore isInserted should return true.
cancelRowUpdates() Aborts the actual changes, sets updated and inserted to false and clears the update cache. Here is the last data set positioned.

Quod vide CSVRecordSource reference implementation.