Actuate JavaScript API classes : Class actuate.report.Label

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-29 lists actuate.report.Label functions.

actuate.report.Label.getBookmark

Syntax

string Label.getBookmark( )

Returns the bookmark name for this Label.

Returns

String.

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.getLabel

Syntax

string Label.getLabel( )

Returns the text of this Label element.

Returns

String.

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( );

(c) Copyright Actuate Corporation 2011