Working With Form and Console Panels

The form panel, implemented by the Ab.form.Form object , displays a single data record and allows the user to change its values. The form panel does not actually store the data values - it holds a reference to an Ab.data.DataRecord object that contains actual field values retrieved from the server.

By default, the form panel retrieves and saves data records from the server, using the standard DataSource API. However, you can bind the form to a custom data model and implement custom loading and saving strategies in your code.

Form methods:

Method Description Parameters
clear() This is a standard panel method, but it has a form-specific implementation. clear() not only clears the form field values, but also requests the default new record values from the server, using DataSource.getNewRecord() . The default values are defined by the Archibus schema, and can be over-written in <field> elements in AXVW using the value attribute.
save() Saves the current form record to the database using the DataSource.saveRecords() method.
deleteRecord() Deletes the current form record using the DataSource.deleteRecords() method.
getRecord() Returns the current record as an Ab.data.DataRecord object. The record contains both current form values entered by the user and old values retrieved from the server (unless this is a new record).
setRecord(record) Sets the current form record. The application code can obtain the record from the server, get it from another panel, or create a new record from scratch. record : Ab.data.DataRecord object;
getFieldValue(name) Returns the locale-neutral value of the specified field name : full field name;
getFieldInput(name) Returns a DOM input reference for the specified field name : full field name;
setFieldValue(name, value) Sets the specified field value in the Ab.data.DataRecord managed by the form, and displays it in the form. The value must be in the localized format. You can use the Ab.data.DataSource.formatValue(fieldName, fieldValue, true) method to localize a value.

name : full field name;

value : locale-neutral value;

getFieldsRestriction() Returns Ab.view.Restriction object created from current form field values.