Show TOC

 Startup Sequence Locate this document in the navigation structure

 

The following startup sequence applies when loading an APF-based application:

  1. Load the HTML document

  2. Instantiate component apf.core

  3. Instantiate component apf.ui

  4. Instantiate component apf.layout

  5. Set up the Web application and build the application UI

The components must be instantiated only after the HTML document has been completely loaded. In particular, self-executing functions shall be avoided. The apf.core component is mandatory. The apf.ui and apf.layout components are optional. They depend on the apf.core component and are instantiated only after the core is complete. For example, the apf.core component contains a message handling entity, which is instantiated early to ensure that error message can be sent.

The startup process is initiated by the browser and uses a startup function that is registered by the API method sap.apf.ready(<function>). This startup function is responsible for loading the configuration file and instantiating the entire application. If required, customers can register their own function to replace the default implementation in the index.html file. Method sap.apf.ready(<function>) executes the registered startup function only after the document has been loaded and is ready.

After all required components have been instantiated, you can set up the Web application and build the application UI by using the startup function as described earlier. The sequence of operations required to set up the Web application is as follows:

  1. Call loadApplicationConfig(<file path>)

    This operation loads the application configuration file along with the static resources defined in the application configuration file.

  2. Create the APF application layout and add it to the DOM.

  3. Process URL parameters by using APF or SAPUI5 functionality. If the analysis path needs a context or needs to map context parameters, create a filter.

  4. Call setContext (<filter>) with this filter.

  5. Register a callback function for application message handling. For more information, see Message Handling.