Reputation: 71
What is the correct syntax for using the event variable within the label boxes (e.g Header Title).
Having a defined event (e.g. Test), what are the possible use? What is the meaning of the following expression?
@{Test:'Alternate Text'!} @{Test}
Are there other available functions?
Upvotes: 2
Views: 60
Reputation: 7680
Events in icCube are objects (base class is viz.event.Event) that implement mainly two methods :
So when you define an event listener @{eventName} it's going to be changed by it's caption() value, unless you are in an MDX expression where it's changed by the asMdx() value.
You can decorate your event in three ways
@{eventName!emptyValue} -> if the event is empty, returns the string 'emptyValue' (without single quotes)
@{eventName:eventFunction} -> calls eventObject.eventFunction , e.g. @{event:asMdx}
@{eventName:'valueIfNotEmpty'} -> if the event exists, return the string 'valueIfNotEmpty' (without single quotes)
More information on the doc.
As it's javascript you're free to add you own methods to the object of the class (e.g. using On Send Event hook in a widget - the JS icon)
The interface that all events implement is :
export interface IEvent {
/**
* Return true if the event is empty.
* @returns {boolean}
*/
isEmptyEvent():boolean;
/**
* Returns the caption of the event.
* @returns {string}
*/
caption():string;
/**
* Returns the value of the event.
* @returns {string}
*/
value():any;
/**
* Returns the event value as MDX expression.
* @returns {string}
*/
asMdx():string;
/**
* Return the event value key
* @return {string}
*/
asKey():string;
/**
* Return the string representation of member key with quotes. If multiple keys present it returns: 'key1', 'key2', 'key3'
* @return {string}
*/
asQuotedKey():string;
/**
* Return the string representation of member captions with quotes. If multiple keys present it returns: 'name1, 'name2', 'name3'
* @return {string}
*/
asQuotedCaption():string;
/**
* Return the array of event keys
* @return {Array}
*/
asKeyArray():string[];
/**
* Returns the event value es MDX set expression.
* @returns {string}
*/
asSet():string;
/**
* Returns the event value as filter initial selection.
* @returns {any}
*/
asFilterInitialSelection():any;
/**
* Return true if the event is selection event. Used for type check.
* @returns {boolean}
*/
isSelectionEvent():boolean;
/**
* Returns the event value as an array.
* @returns {any[]}
*/
getSelectedItems():any[];
/**
* Returns a serialized event object.
* @returns {EventGuts}
*/
asReportParam():EventGuts;
}
Upvotes: 2