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 4-35 lists actuate.report.Label functions.
Table 4-35  
actuate.report.Label.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( ));
actuate.report.Label.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);
}
actuate.report.Label.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);
}
actuate.report.Label.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( ));
actuate.report.Label.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);
}
actuate.report.Label.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")
}
actuate.report.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( );
actuate.report.Label.show
Syntax
void Label.show( )
Shows this element.
Example
Use show( ) to reveal a report label, as shown in the following code:
myLabel.show( );
actuate.report.Label.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.
Parameters
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( );

Additional Links:

Copyright Actuate Corporation 2012