Auto-Wiring During View Initialization

Two auto-wired events occur during view loading: afterViewLoad() and afterInitialDataFetch() . The view/panel/controller loading sequence, in simplified form, is:

  1. Construct all dataSource and panel objects.
  2. Initialize view state.
  3. Perform the layout for all panels.
  4. Call afterViewLoad() methods for all controllers.
  5. Perform initial data fetch for all panels (panels will refresh themselves unless panel/@showOnLoad=false ).
  6. Call afterInitialDataFetch() methods for all controllers.


For example, in order to force a panel to refresh again (presumably after setting a restriction), you should do it in the afterInitialDataFetch() controller method, and not in afterViewLoad() :

var enterTabController = View.createController('enterTabController', {
afterInitialDataFetch: function() {
this.activityForm.refresh();
},

activityForm_afterRefresh: function(){
this.activityForm.actions.get('enterSubmit').forceDisable(true);
}
});


Also consider setting the panel/@showOnLoad to false, to avoid the unnecessary initial data fetch from the server for this panel.