IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Create user interfaces for business processes > Coach and Coach View reference information

Framework managed versus view managed content for coaches

At run time, the content inside a content box of a coach can be managed by the runtime framework, or by the view. By default, the framework manages the content, but if you want to code your own custom behavior, you can choose that the content be managed by the view.

There are times when you might want to override the default behavior of the framework when a coach is rendered.

For example, when a view is bound to data that is an array, the framework creates a view for each index element in the array. You might want to create views for a different set of elements, in which case you can choose the option to let the view manage its own content.

The option for a view to manage its own content is set as a property on a content box at design time. To set the option:

  1. Open the coach view, and switch to the Layout tab.

  2. Click the content box on the editor.

  3. In the Properties page, click the option The View will manage its own content.

  4. You can write your custom code in a callback method such as load() to manage the content. See View managed coaches


Framework managed content

When the content of the view is managed by the framework, the runtime framework handles the content of a content box as follows:

The section view that is available in the Coaches toolkit is an example of a view that has its content managed by the framework.


View managed coaches

When the view manages its own content, the view is responsible for handling the content inside the content box. The following is the typical scenario:

  1. Initialize and render the sub-views:

    • If the content box inherits a data binding that is an array, the view typically does the following in one of its callback methods, for example load():

      • the view deeply clones the DOM node of the content box n times where n is the number of elements of the data binding array.

      • Performs initialization logic as required, for example add/remove/update/decorate the content of the cloned node.

      • Invokes the framework method this.context.createView()

    • If the content box inherits a data binding that is not an array, the view does the following in one of the its callback methods, for example load()

      • Performs initialization logic as required

      • Invokes the framework method this.context.createView()

  2. Add/delete content dynamically

    • Add content (for example add new row in table)

      • Create the new binding object and add it to the binding array using DataBinding API
      • Invoke the framework method this.context.createView()

    • Delete content (for example delete row in table)

      • delete the binding object for that row directly or indirectly
      • Invoke the framework method this.context.deleteView()

The table view that is available in the Coaches toolkit is an example of a view that manages its own content.

Coach and Coach View reference information


Related concepts:
Data binding for Coach Views