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 44‑37 lists actuate.report.TextItem functions.
Table 44‑37 actuate.report.TextItem functions
Function
Description
Returns the bookmark name for this Text
Returns the HTML element for this Text
Returns the report element instance id
Returns the page content to which this element belongs
Returns the text in this Text element
getType( )
Returns the Text element’s type
hide( )
Hides this element
show( )
Shows this element
submit( )
Applies changes made to this element
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( ));
}
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);
}
getInstanceId
Syntax
string TextItem.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(myTextItem){
var elementID = myTextItem.getInstanceId( );
alert (elementID);
}
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);
}
getText
Syntax
string TextItem.getText( )
Returns the text of this Text element.
Returns
String. The content text.
Example
This example displays the text of the myTextItem object in an alert box:
alert("Text content for myTextItem is " + myTextItem.getText( ));
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");
}
hide
Syntax
void TextItem.hide( )
Hides this element.
Example
This example hides myTextItem:
myTextItem.hide( );
myTextItem.submit( );
show
Syntax
void TextItem.show( )
Shows this element.
Example
This example shows myTextItem:
myTextItem.show( );
myTextItem.submit( );
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.
Parameter
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( );