JavaScript API Reference/Ab.form.Form object

refresh(restriction, newRecord)

Load and display the form field values from the server, using specified restriction to select a single data record to be loaded. If the restriction is not specified, the first available data record will be loaded.

Parameters

  • restriction (JS object): (optional) restriction to be applied to the control content;
  • newRecord (boolean): (optional) flag for the control to display in the new record mode, with default values.

Example

Display the selected project in the edit form.

var form = View.panels.get( 'project');
var restriction = {'project.project_id_id': project_id};
form.refresh(restriction);

Display the edit form with default values to create a new project.

var form = View.panels.get( 'project');
form.refresh({}, true);