Class actuate.report.Label
Description
A container for a Label element in a report. Label provides functions to operate on a Label element, such as retrieving the label text and getting the HTML DOM element from the report label.
Constructor
The Label object is constructed by viewer.PageContent.getLabelByBookmark( ).
Function summary
Table 44‑35 lists actuate.report.Label functions.
Table 44‑35 actuate.report.Label functions
Function
Description
Returns the bookmark name for this Label
Returns the HTML element for this Label
Returns the report element instance id
Returns the text of this Label element
Returns the page content to which this element belongs
Returns the Label’s element type
hide( )
Hides this element
show( )
Shows this element
submit( )
Applies changes made to this gadget
getBookmark
Syntax
string Label.getBookmark( )
Returns the bookmark name for this Label.
Returns
String. The Label’s bookmark.
Example
This example displays the Label’s bookmark in an alert box:
alert(myLabel.getBookmark( ));
getHtmlDom
Syntax
HTMLElement Label.getHtmlDom( )
Returns the HTML element for this Label.
Returns
HTMLElement.
Example
This example displays the HTML DOM element for this Label inside a red border
function showHtmlDom(myLabel){
var domNode = myLabel.getHtmlDom( );
var box = document.createElement('div');
box.style.border = '2px solid red';
var label = document.createElement('h2');
label.innerHTML = 'The HTML DOM:';
box.appendChild(label);
box.appendChild(domNode);
document.body.appendChild(box);
}
getInstanceId
Syntax
string Label.getInstanceId( )
Returns the instance id of this report element.
Returns
String. The instance id.
Example
This example displays the instance ID of the report element in an alert box:
function showID(myLabel){
var elementID = myLabel.getInstanceId( );
alert (elementID);
}
getLabel
Syntax
string Label.getLabel( )
Returns the text of this Label element.
Returns
String. The Label text.
Example
This example displays the text of the myLabel object in an alert box:
alert("Label element text is " + myLabel.getLabel( ));
getPageContent
Syntax
actuate.viewer.PageContent Label.getPageContent( )
Returns the page content to which this Label belongs.
Returns
actuate.viewer.PageContent. report content.
Example
This example displays the viewer ID of the page content in an alert box:
function showViewID(myLabel){
var pageContent = myLabel.getPageContent( );
var pageViewerID = pageContent.getViewerId( );
alert (pageViewerID);
}
getType
Syntax
string Label.getType( )
Returns the report element type of this object, which is Label.
Returns
String. "Label".
Example
This example checks the report element type and displays an alert if the type is not "Label":
if (myElement.getType( ) != "Label"){
alert("Type mismatch, report element type is not Label")
}
hide
Syntax
void Label.hide( )
Hides this element.
Example
Use hide( ) to hide a report label, as shown in the following code:
myLabel.hide( );
show
Syntax
void Label.show( )
Shows this element.
Example
Use show( ) to reveal a report label, as shown in the following code:
myLabel.show( );
submit
Syntax
void Label.submit(function callback)
Submits all the asynchronous operations for this Label. Submit( ) triggers an AJAX request for all asynchronous operations. When the server finishes the processing, it returns a response and the results are rendered on the page in the label container.
Parameter
callback
Function. The function to execute after the asynchronous call processing is done.
Example
Use submit( ) to execute changes on a Label object, as shown in the following code:
myLabel.submit( );