bpmext.ui
Contains general view and container helper functions
Methods:

getNearestValidationContainer() Returns: {com.ibm.bpm.coach.CoachView}
Gets the nearest container view on the validation stack
Example

getEventHandlingFunction(view, eventName) Returns: {function}
Retrieve an event handling function.
Example

getCoachNGViewPath(null) Returns: {string}
null
Example

getRequiredViews([onlyEmpty], [fromView], [includeDefaultVisibilityViews]) Returns: {com.ibm.bpm.coach.CoachView[]}
Convenience method which finds all views in a tree that have visibility required, with the specified view as the root. If no root is specified, all views on page will be checked
Examples

getFunctionContext(functionName, fromView) Returns: {Object}
Sometimes, event handlers in views need to call functions instead of using inline logic.
A function can be located in the view that fires the event, in an "ancestor" of the view, or at
the top level in a <script> section of the coach page. This function helps locate the named
function by starting at fromView and working up the ancestor chain. It stops as soon
as it finds a matching function in the closest ancestor to fromView.
Example

getContainerPath(view)
Returns the absolute path of the view/section (assumes the view was already initialized with bpmext.ui.loadContainer)

getOption(view, optionName, defaultValue) Returns: {ANY}
Retrieves the configuration option value - or the default value if the option is not set
Example

eventSubscriptionExists(eventName, view) Returns: {boolean}
Determine if a view is subscribing to an event.
Example

executeEventHandlingFunction(view, eventName, argument) Returns: {object}
Executes an event handling function. If the event does not exist the returned value will always be true. When the event is an inline function it always returns true unless the implementation explicitly returns false. When the event calls a custom function the return value is the data returned from the function.
Example

getChildContainers(view, [deep) Returns: {com.ibm.bpm.coach.CoachView[]}
Will return a list of all child container views of the specified view
Example

presetConfigOption(view, childViewControlId, configOptionName, configOptionValue)
Can preset value of configuration option of view during construction phase in Inline Javascript. Use in situations where you need to programmatically preset config option because it is loaded only once during load event handler.
Example

makeUniqueId(prefix) Returns: {string}
Returns a unique ID to be used on the currently-displayed page. The scope of the uniqueness in only the currently-displayed BPM Coach page.
Example

getViewValidationErrors(view) Returns: {string[]}
Returns the validation errors for the specified view
Example

alert(title, text, style, [topic], timeout, id, data, iconSetting.showIcon, iconSetting.iconName)
Broadcasts an alert withe the parameters specified
Example

substituteObject(view, type, propertyName, defVal)
Low-level data management method to substitute a view binding or a configuration property
that is not set/undefined with a "pseudo" object that works like a real one. This helps simplify
code that would otherwise need to check if a binding or config option is set of not
Example

forEachViewSibling(view, callback, includeContainers)
Convenience iterator function. Calls the callback function for each of the view's identically named siblings
in a repeating view such as a Table, or Horizontal/Vertical layout. Each call to the callback function is
passed a reference to the view being iterated over, NOTE that this includes the specified view.
Example

getEffectiveVisibility(view)
returns the actual visibility of a view. Adjusts based on the visibility of the parent view.

getView(viewPath, fromView) Returns: {com.ibm.bpm.coach.CoachView}
Retrieves the view corresponding to the path specified. Note that the view path never contains section
(e.g. Horizontal Section, etc...) references.
Example

registerEventHandlingFunction(view, eventName, argument)
Register an event handling function.
Example

pushValidationContainer(view)
Push the specified view into the validation container stack
Example

presetEventHandler(view, childViewControlId, eventName, eventHandler)
Can preset event of view in events section during construction phase in Inline Javascript. Use in situations where you need to programmatically preset event because it is loaded only once during load event handler.
Example

setViewEnabled(enabled, required)
Enable/disable this view/control
Example

setViewData(data, viewPath, fromView) Returns: {Object}
Sets the bound data for the view corresponding to the path specified
Example

loadContainer(view)
Registers a section Coach View (but not a regular view) as an SPARK view/section. Typically called in the
load event handler of the Coach View.
A view is not addressable through page.ui.get("/MySection1") or ${/MySection1} for example until loadContainer completes.
Example

getContainer(viewPath, fromView) Returns: {com.ibm.bpm.coach.CoachView}
Retrieves the view corresponding to the path specified.
Note that the container path never contains section (e.g. Horizontal Section, etc...)
references other than for the last element of the path (which references the desired section).
Example

verifyEventHandlingFunctionRegistration(view, eventName)
Checks if an event handling function has been defined for this event. If an event is registered with no parameters.
Example

substituteConfigOption(view, propertyName, defVal)
Low-level data management method to substitute a view configuration property
that is not set/undefined with a "pseudo" object that works like a real one. This helps simplify
code that would otherwise need to check if a config option is set of not (this method does nothing
if the option specified in propertyName is already set (i.e. view.context.options[propertyName] != undefined)
Example

getFunction(functionName, fromView) Returns: {function}
Sometimes, event handlers in views need to call functions instead of using inline logic.
A function can be located in the view that fires the event, in an "ancestor" of the view, or at
the top level in a <script> section of the coach page. This function helps locate the named
function by starting at fromView and working up the ancestor chain. It stops as soon
as it finds a matching function in the closest ancestor to fromView.
Example

removeViewValidationError(view, id)
Removes the error on the specified id in the specified view
Example

setupFormulaTriggeredUpdates(null, function, function)
Registers formula triggers for the specified view
Example

loadView(view)
Registers a Coach View (but not a section) as an SPARK view. Typically called in the
load event handler of the Coach View.
A view is not addressable through page.ui.get("/MyView1") or ${/MyView1} for example until loadView completes.


Note: Must never be called before calling bpmext.ui.setupFormulaTriggeredUpdates
Example

getChildViews(view, [deep) Returns: {com.ibm.bpm.coach.CoachView[]}
Will return a list of all child views of the specified view
Example

getValidationContainers() Returns: {com.ibm.bpm.coach.CoachView[]}
Returns the validation container stack
Example

removeEventSubscription(eventName, view)
Removes the specified event from the list of subscribed events for the specified view
Example

unloadContainer(view)
Deregisters a section Coach View (but not a regular view) from the view tree. Typically called in the unload event handler of the Coach View.
Example

addViewValidationError(view, id, text)
Adds the error of the specified id in the specified view
Example

getInvalidViews([view]) Returns: {com.ibm.bpm.coach.CoachView[]}
Convenience method which checks the validity of all views in a tree (via the isValid() method), with the specified view as the root. If no root is specified, all views on page will be checked
Examples

addEventSubscription(eventName, callback, view, [persistent])
Add an event subscription to a view.
Example

publishEvent(eventName, payload, [persistent], [async])
Publish an event.
Example

updateViewValidationState(view, event)
Merges the current set of validation errors on the view with the errors identified in event.
Example

isViewExplicitlyLoaded(view) Returns: {boolean}
Returns an indication of whether or not this view has been explicitly loaded
Example

popValidationContainer(view)
Pop the specified view from the validation container stack
Example

unloadView(view)
Deregisters a Coach View (but not a section) from the view tree. Typically called in the unload event handler of the Coach View.
Example

getViewPath(view)
Returns the absolute path of the view (assumes the view was already initialized with bpmext.ui.loadView)

getViewData(viewPath, fromView) Returns: {Object}
Retrieves the bound data for the view corresponding to the path specified.
Note that the view path never contains section (e.g. Horizontal Section, etc...) references.
Example