JavaScript API Reference/Ab.view.View object

View.openDialog(url, restriction, newRecord, parameters)

Opens a dialog and loads the specified view.

See also: View-Level Security

Parameters

Parameter Description
url (String) URL of the content to be displayed, typically a name of the view file
restriction (JS object) (optional) restriction to be applied to the dialog content
newRecord (boolean) (optional) flag for the dialog view to display in the new record mode, for form views
parameters (JS object) (optional) additional style options, including width , height , closeButton (defaults to true ), maximize (defaults to false ), and auto-wired functions afterViewLoad , afterInitialDataFetch and callback ;

Example

var restriction = {'rm.bl_id':bl_id, 'rm.fl_id':fl_id, 'rm.rm_id':rm_id };
var workRequestId = View.panels.get('exWorkRequest_wrForm').getFieldValue('wr.wr_id');

View.openDialog('ab-select-room.axvw', restriction, false, {
width: 300,
height: 400,
closeButton: false,
maximize: true,
afterViewLoad: function(dialogView) {
var selectRoomController = dialogView.controllers.get('selectRoomController');
selectRoomController.workRequestId = workRequestId;
},
callback: function(res) {
var clause = res.clauses[2];
var value = clause.value;
View.panels.get('exWorkRequest_wrForm').setFieldValue('wr.rm_id', value);
}
});