If you must run custom logic when a widget is instantiated, then add an onLoad function to the widget JavaScript’s return object:

onLoad: function(widget) {
  //onLoad code here.
}

onLoad() will run once the widget has finished loading and is populated with the necessary data. This is the main access point to configure data for the widget after its properties have been loaded and the system is ready to display the widget. As the onLoad() function is only called the first time the widget is instantiated, when returning to the same “page”, the widget does not need to be re-instantiated, so onLoad() is not called again.


Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices