Actuate JavaScript API classes : Class actuate.report.TextItem

Class actuate.report.TextItem

Description

A container for a text element in a report. TextItem provides functions to operate on a text element, such as retrieving the text value and getting the HTML DOM element from the report text element.

Constructor

The TextItem object is constructed by viewer.PageContent.getTextByBookmark( ).

Function summary

Table 4-31 lists actuate.report.TextItem functions.

actuate.report.TextItem.getBookmark

Syntax

string TextItem.getBookmark( )

Returns the bookmark name for this text item.

Returns

String.

Example

This example displays the table’s bookmark in an alert box.

function alertBookmark(myTextItem){
  alert(myTextItem.getBookmark( ));
}

actuate.report.TextItem.getHtmlDom

Syntax

HTMLElement TextItem.getHtmlDom( )

Returns the HTML element for this Text.

Returns

HTMLElement.

Example

This example displays the HTML DOM element for this text item inside a red border.

function showHtmlDom(myTextItem){
  var domNode = myTextItem.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.TextItem.getPageContent

Syntax

actuate.viewer.PageContent TextItem.getPageContent( )

Returns the page content to which this Text belongs.

Returns

actuate.viewer.PageContent. report content.

Example

This example displays the viewer ID of the page content in an alert box.

function showViewID(myTextItem){
  var pageContent = myTextItem.getPageContent( );
  var pageViewerID = pageContent.getViewerId( );
  alert (pageViewerID);
}

actuate.report.TextItem.getText

Syntax

string TextItem.getText( )

Returns the text of this text element.

Returns

String.

Example

This example displays the text of the myTextItem object in an alert box.

alert("Text content for myTextItem is " + myTextItem.getText( ));

actuate.report.TextItem.getType

Syntax

string TextItem.getType( )

Returns the report element type of this object, which is Text.

Returns

String. "Text"

Example

This example checks the report element type and displays an alert if the type is not "Text".

if (myTextItem.getType( ) != "Text")
  {
  alert("Type mismatch, report element type is not Text")
  }

actuate.report.TextItem.hide

Syntax

void TextItem.hide( )

Hides this element.

Example

This example hides myTextItem.

myTextItem.hide( );
myTextItem.submit( );

actuate.report.TextItem.show

Syntax

void TextItem.show( )

Shows this element.

Example

This example shows myTextItem.

myTextItem.show( );
myTextItem.submit( );

actuate.report.TextItem.submit

Syntax

void TextItem.submit(function callback)

Submits all the asynchronous operations for this TextItem. The submit( ) function triggers an AJAX request for all asynchronous operations. The server returns a response after processing. The results render on the page in the TextItem container.

Parameters

callback

Function. The function to execute after the asynchronous call processing is done.

Example

This example uses submit( ) after calling show( ) to show myTextItem.

myTextItem.show( );
myTextItem.submit( );

(c) Copyright Actuate Corporation 2011