Getting Panel References

The Ab.view.View object manages a collection of all panels defined in that view. You can get a reference to any panel by its id, as defined in the AXVW file. As a shorthand to the Ab.view.View object, you can simply refer to it as View in your JavaScript:

// in AXVW
<panel type="form" id="requestForm">

// in JavaScript
var requestForm = View.panels.get('requestForm');
requestForm.show(false);


The controller has auto-wired references to all panels as data variables, so in your controller object the example above can be written simply as:

this.requestForm.show(false);


You can also iterate over all view panels, for example to perform some operation for each panel:

// hide all panels except the Employee grid
View.panels.each(function(panel) {
panel.show(panel.id == 'employeeGrid');
});