IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Create user interfaces for business processes > Developing reusable Coach Views

Data binding for Coach Views

Binding a Coach View to a business object creates an association between data and a user interface for it.

To associate a business object and a Coach View, you bind the Coach View to the business object. When the view definition for the Coach View declares a binding type, you must bind the Coach View to data. Without the data that is provided by the binding, the Coach View might not function properly. When the view definition does not declare a binding type, the data binding is optional.

For example, you have an Address business object. To display one or more parameters of that business object, you create a Coach View.

You then add the Address business object as a variable to that Coach View. The Address business object now has an associated Coach View. Although a business object can have an association with many Coach Views, a Coach View can have only one binding.

For example, the Address business object can have an associated Coach View that displays all the address information. It can also have and association with a different Coach View that displays just the postal code.

When a business object is associated with a Coach View, you can drop the parameters of the business object onto the layout. These parameters are available as variables on the palette.

If there is a Coach View that is associated with that data type of the variable, the layout displays that Coach View.

For example, if you drop a string onto the layout, you can see a Text stock control that is bound to the string. If the variable is a business object that has an associated Coach View, you can see that Coach View. If the business object does not have an associated Coach View, you can see a placeholder message.

If the variable is a list, what you drop onto the layout determines the Coach View that Process Designer adds to the layout. You can change the Coach View that the designer selected.

When you have a Coach View definition that contains a Content Box stock control and an instance of that Coach View is bound to a list, the contents in the content box repeats for each list item. The content box can contain Coach Views that are also bound to lists or elements of lists. When you have this arrangement, the list of the container (outer) Coach View controls the repetition. The list of the contained (inner) Coach View provides the contents.

For example, you have a section that is bound to a list of names. The content box for the section contains a Text stock control that is bound to the currentItem of the list of names. At run time, the section repeats for each name in the list. Each repeating section contains a field. In the first section, the field contains the first name. The field in the second section contains the second name, and so on.

You can bind the outer Coach View and the inner Coach Views to different lists. However, if you bind an inner Coach View to the currentItem of a different list, the two lists must contain the same number of items.

If the two lists do not have the same number of items, users see a message. The specific message depends on whether the inner list contains more or fewer items. If the outer list has more items, the users see some highlighted Coach Views in the repeated content. They are highlighted because they do not have data.

For example, outerList[] has three items and innerList[] has two items. The Coach Views that are bound to innerList.currentItem repeat three times, but only the first two have data. If the contained list has fewer items during run time, the user cannot see these excess items because the inner list has nowhere to display them.

For example, outerList[] has four items and innerList[] has five items. The Coach Views that are bound to innerList.currentitem repeat four times. The user cannot see the Coach Views for the fifth innerList[] item.

Developing reusable Coach Views


Related concepts:
Coach Views
Configuration options and properties
Framework managed versus view managed content for coaches


Related reference:
Binding data and configuration options


Related information:
Business objects and variables