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

Generate a unique ID for a coach view

In some situations you might want to use the ID attribute for your DOM elements within a coach view. However, all DOM IDs must be globally unique.

For example, during collaboration the default highlighting behavior is implemented based on a unique DOM ID. To ensure a unique ID, you can use the $$viewDOMID$$ placeholder keyword. At run time, this keyword will be replaced by the Coach View DOM ID.

Because Coach Views are reusable, multiple instances of the same Coach Views could be used in a single Coach. As a result, unique DOM IDs are generated for all Coach Views automatically. By using $$viewDOMID$$ in your Coach View implementation, you can ensure that all of your DOM elements have DOM IDs that are globally unique.

For example, you might want to highlight an element such as a button at run time. You can create your element using custom HTML, and assign the DOM ID attribute by prefixing with $$viewDOMID$$. When the view is rendered, the $$viewDOMID$$ attribute will be replaced by a unique id (the DOM ID of your Coach View) for the element. To generate a unique ID:


Limitation

This approach does not work if the view that is using this placeholder is embedded in a repeating context, for example a table or a repeating section. This is because the repeating construct occurs on the client, whereas the substitution of the placeholder with a unique ID occurs when the coach is generated on the server. As a result the same DOM ID will be used for all the elements in the Coach View, which means the ID will not be unique.

Coach and Coach View reference information