bpmext.ui.View
Contains view specific helper functions
Methods:

getParent(literal) Returns: {bpmext.ui.View}
Retrieve parent view, or undefined if no parent exists
NameTypeDefaultDescription
literal{boolean}Return the literal parent (which may be a visual-only section) of this control
Example
ChildView1.ui.getParent(); //Returns reference to the view containing ChildView1

isSubscribingToEvent(eventName) Returns: {boolean}
Tests if a view subscribes to an event, returns true if addEventSubscription() was called previously with the given <eventName>
NameTypeDefaultDescription
eventName{string}Name of event for which to test the subscription
Example
var subFlag = MyView.isSubscribingToEvent("MY_EVENT1");

getChild(name, index) Returns: {bpmext.ui.View}
Retrieve immediate child control
NameTypeDefaultDescription
name{string}Name of a control that is an immediate literal child of this control
index{integer}Index of child control (if the child control is repeating)
Example
ChildView1.ui.getChild("Text1"); //Returns reference to the child named Text1

getAncestor(name, literal) Returns: {bpmext.ui.View}
Retrieve ancestor view
NameTypeDefaultDescription
name{string}Return a control in the ancestor chain of this control matching the name specified
literal{boolean}Searches the literal ancestor(s) (which may be a visual-only section) of this control
Example
ChildView1.ui.getAncestor("AncestorView1"); //Returns reference to the ancestor named AncestorView1

getOption(optionName, defVal) Returns: {ANY}
Retrieves the configuration option value - or the default value if the option is not set
NameTypeDefaultDescription
optionName{string}The name of the configuration option for the view
defVal{ANY}(Optional) The default value to return if the option is not set
Example
var prop1 = MyView.ui.getOption("prop1", "D"); //Return the value of MyView.context.options.prop1, or "D" if .context.options.prop1 is not set

publishEvent(eventName, payload)
Publishes the named event. Triggers the execution of the callback functions for each respective subscriber to the event.
NameTypeDefaultDescription
eventName{string}Name of event to be published
payload{Object}Additional (optional) data to send to event subscribers
Example
MyView.publishEvent("MY_EVENT1", "My test data");

getSibling(name) Returns: {bpmext.ui.View}
Retrieve sibling view
NameTypeDefaultDescription
name{string}Return a control on the same addressing level as this control
Example
ChildView1.ui.getSibling("OtherView1"); //Returns reference to the sibling named OtherView1

removeEventSubscription(eventName)
Unsubscribes from notifications from the named event.
NameTypeDefaultDescription
eventName{string}Name of event previously registered
Example
MyView.removeEventSubscription("MY_EVENT1");

get(path, index) Returns: {bpmext.ui.View}
Retrieve child view
NameTypeDefaultDescription
path{string}Path to the view (start path with / for absolute addressing)
index{number}Index of the child view if the path refers to an array of views
Example
MyView.ui.get("ChildView1/Text1")

addEventSubscription(eventName, callbackFunction)
Registers a callback function with an event name. When the event is broadcast with publishEvent, the callback function will be called.
NameTypeDefaultDescription
eventName{string}Name of event associated with the callback function
callbackFunction{function}Reference to the callback function
Example
//alert displayed when publishEvent("MY_EVENT1", "test data") is called
MyView.addEventSubscription("MY_EVENT1", function(){alert("Event triggered!");});

getAbsoluteName(path) Returns: {string}
Retrieve the fully-qualified path to the view (starting for the top of the view tree)
NameTypeDefaultDescription
path{string}Relative path to the view
Example
MyView.ui.getAbsoluteName("ChildView1/Select2"); //returns /ViewA/ChildView1/Select2

invoke(functionName, args) Returns: {ANY}
Invoke a function on the view or its ancestor chain
NameTypeDefaultDescription
functionName{string}Name of the function to invoke
args{...ANY}0 or more arguments passed to the function (up to 9 total)
Example
me.ui.invoke("multiply", 34, 87);

getCount(path) Returns: {number}
Retrieve the number of child views for a given path (without using the [index] notation)
NameTypeDefaultDescription
path{string}Path to the view array (start path with / for absolute addressing)
Example
MyView.ui.getCount("ChildView1/Table1/Text1")

getIndex() Returns: {number}
Retrieve the index of this view (assuming it is in a repeating container). Note that this is not necessarily the index of the item in the data that is backing the repeating view. In fact, using this method on two different views from the same repeating entry could give different values.
Example
alert("Index of this control: " + me.ui.getIndex());