DataBinding and Forms
Databinding is the process of loading data into a form from a datatable, or creating a new record in a table and initializing the form to load data into that record.
The following types are available: New, Update, Copy, and None.
The databinding mode is set by the action that loads the form, usually executed by a menu item with a ShowScreen action, or by a script function.. The New, Update, Copy modes only apply when the form is a child form of a grid. The table assigned to that grid is used for the databind operation and the currently selected row is used for the copy or update operation as required.
Note: It is not necessary to show the form containing the parent grid, but it must be created.
NewRecord
A form shown with a 'new' databinding creates a new record for the table referenced by the parent grid. It is not added to the table until the Save action is executed.
Starting with an empty grid, when the “New
” Context Menu item is clicked, the
Showscreen action creates the new record, links it to the 'New' form, and the form is shown. The primary key of the new record will initially be 'New<id>' where id is an incrementing number, e.g. New1. When the record is synched with the database via the Host, the id will be updated with that supplied by the database.
The user enters the required data, and the Save / Close actions executed either from a button or a menu item. The new record is added into the table. Note the changes are not sent to the database until a Synch rule is run.
When the “Save” button is clicked, the Save action adds the record to the table, and the Close action closes the form to reveal the newly added record in the grid. The parent grid is automatically updated with the new data.
*
UpdateSelected
A form shown with an 'updateselected' databinding allows the user to load the contents of a record into a form and make changes to that record, and save the changes back into the record.
The “Save” button executes a Save action followed by a Close action to load the new data back into the record and close the form. The parent grid is automatically updated with the new data.
CopySelected
Showing a form with 'copy' databinding is the same as 'new' except the contents of the new record are initialized with the contents of the currently selected record in the grid.
Find Screens
A
find screen does not use databindng, it is a kind of screen used to search records in a table according to search criteria, based on user input to the form. The results can be viewed in a grid, or, if just one record is required, in the same or another form. Alternately,
Find can be viewed as a user directed synchronization (synch) rule or filter. Often, it is not known what data will be pertinent to the user before loading the project. Therefore, a find screen can be used to allow the user to filter the data.
A synch rule must be created to be used in conjunction with a
Find action. This synch rule will perform a user directed query using the data on the form to select records for display.
A find screen is created in a similar fashion as a New and Update screen. When the user clicks “Find”,on the form, a
Find action will be performed to run the Synch rule on the server for data retrieval. The
Find action will show a progress screen and wait until the Find operation is completed. At this point, a the find form will be closed and the new records loaded to the grid.
Query data is added into the
text box and the
Find button is clicked .
When the “Find” button is clicked, the
Save and
Find actions are run. The
Find action will call a previously created sync rule. The found data screen is then shown.
Please
Log In to add a comment