Textbox Objects

Textbox objects represent each textbox in an Image Template file. There can be any number of textbox objects in an Image Template file. Each textbox object has its own name, data, and formatting options.

Note: The examples in this section assume that the textbox object has the default name of textbox. However, textbox objects are not always named textbox. Substitute the appropriate object name in place of textbox.

Textbox objects have the following methods:

 

method

 

addITXML

Syntax

 

textbox.addITXML(itxml)

Description

 

Inserts the specified ITXML properties into this textbox object. If a property has already been defined (e.g., in the Image Template file), this statement overrides it. If no Image Template file is currently open, this command creates a new Image Template file and inserts the specified object into the empty Image Template file. The ITXML in this file is appended to the ITXML from the Image Template file and from any previous addITXML commands.

Adding an image object that has the same name as an existing image object in the Image Template file replaces the existing image object with the new image object.

The textbox.addITXML statement is useful for accessing features of Corda Server™ not available through the PCScript API. It allows you to add to or modify this object's definition within the actual Image Template file.

For example, PCScript does not allow you to dynamically define the border settings for a textbox. However, you can use textbox.addITXML to change the ITXML that defines the border settings. Example 1 below illustrates how to do this. Examples 2 and 3 show how this statement affects the textbox object's definition in the Image Template file.

Note that this only applies to properties of the <cit:textbox> object. To modify attributes of the <cit:textbox> tag (e.g., common="top:20;"), use the textbox.setITXMLAttributes method.

Parameters

 

textbox.addITXML accepts the following parameter:

 

 

itxml

String

 

 

A string of ITXML that contains valid properties for the <cit:textbox> tag. For more information, see ITXML.

Examples

 

Example 1: textbox.addITXML Method Call

textbox.AddITXML(<cit:textbox-settings show-border="true"/>)

Example 2: Textbox Definition before Calling addITXML in Example 1

<cit:textbox name="textbox" >

...

<cit:textbox-settings show-border="false">

...

</cit:textbox-settings>

</cit:textbox>

Example 3: Textbox Definition after Calling addITXML in Example 1

<cit:textbox name="textbox" >

...

<cit:textbox-settings show-border="true">

...

</cit:textbox-settings>

</cit:textbox>

 

method

 

ddEnable

Syntax

 

textbox.ddEnable(URL [, Target])

Description

 

Adds a drilldown effect to this textbox.

Drilldown effects include linking to a different Web page or executing a Javascript* function. The drilldown effect occurs whenever a user clicks a specific data item. For more information about drilldown effects, see Building Drilldown.

Parameters

 

textbox.ddEnable accepts the following parameters:

 

 

URL

{ URL | Javascript function }

 

 

The Web page or Javascript function that the textbox drills down to.

If the URL parameter is a Web page, the link is relative to the location of the Web page that contains the Corda® image. Prefix the URL with http:// to specify an absolute path.

If the URL parameter is a Javascript function, it must be prefixed with Javascript:. The function must also be declared within the Web page that contains the Corda image. For more information about drilling down to Javascript functions, see Drilldown to Javascript Functions.

 

 

Target

String

 

 

(Optional) The target window or frame that the data items drills down to. Do not use when drilling down to a Javascript function.

Example

 

textbox.ddEnable Method Calls

textbox1.ddEnable(http://www.myserver.com/box.html)

textbox2.ddEnable(Javascript:dostuff(true))

 

method

 

description

Syntax

 

textbox.description(description)

Description

 

Specifies a description for this textbox object. The description is displayed at the beginning of this textbox's section in the image's descriptive text. For more information, see Descriptive Text in the Corda Builder™ User Guide.

Parameters

 

textbox.description accepts the following parameters:

 

 

description

String

 

 

The description of this textbox.

 

method

 

hide

Syntax

 

textbox.hide()

Description

 

Hides this textbox.

Use the textbox.show command to make the textbox object visible again after using this command.

 

method

 

setITXMLAttributes

Syntax

 

textbox.setITXMLAttributes(attributes)

Description

 

Inserts the specified attribute assignments into this textbox object's ITXML tag. If an attribute has already been assigned (e.g., in the Image Template file), this statement overrides its assignment.

The textbox.setITXMLAttributes statement is useful for accessing features of Corda Server not available through the PCScript API. It allows you to add to or modify this object's definition within the actual Image Template file.

For example, PCScript does not allow you to dynamically redefine the size and position of this object. However, you can use textbox.setITXMLAttributes to change the ITXML attributes that define these settings. Example 1 below illustrates how to do this. Examples 2 and 3 show how this statement affects the textbox object's definition in the Image Template file.

Note that this only applies to attributes listed in this object's <cit:textbox> tag. To modify properties of the <cit:textbox> tag (e.g <cit:textbox-settings>), use the textbox.addITXML method.

Parameters

 

textbox.setITXMLAttributes accepts the following parameters:

 

 

attributes

String

 

 

A string of ITXML attribute assignments, each separated by a blank space. This string is essentially what follows textbox in a <cit:textbox> tag.

For example, to set the top attribute to 100, this string reads common="top:100;". This string can contain any number of attribute assignments.

For more information about ITXML, see ITXML.

Examples

 

Example 1: textbox.setITXMLAttributes Method Call

textbox.SetITXMLAttributes(common="top:20;left:20;width:300;height:300")

Example 2: Textbox Definition before Calling setITXMLAttributes in Example 1

<cit:textbox name="textbox" common="top:8;left:91;width:270;height:340">

...

</cit:textbox>

Example 3: Textbox Definition after Calling setITXMLAttributes in Example 1

<cit:textbox name="textbox" common="top:20left:20;width:300;height:300">

...

</cit:textbox>

 

method

 

setText

Syntax

 

textbox.setText(TextString)

Description

 

Sends the specified text to the textbox

Force a new line in the textbox by inserting "\n" where you want the new line to occur (see the example below).

Note: When forcing a new line in Javascript, \n is interpreted as an escape code. Use \\n in Javascript to insert a new line.

Parameters

 

textbox.setText accepts the following parameters:

 

 

TextString

String

 

 

The text that is displayed in the textbox.

If it contains any spaces or irregular characters, URL encode it when not using the Corda Embedder. For more information about URL encoding issues, see Encoding Issues with Extended Characters.

Example

 

Setting the Text in a Textbox

textbox.setText(Here's Line 1\nAnd Here's Line 2)

 

method

 

show

Syntax

 

textbox.show

Description

 

Shows the current textbox.

By default, all objects are visible. Use this command to make a textbox object visible again after using the textbox.hide command.

 

method

 

suppressAutoDescription

Syntax

 

textbox.suppressAutoDescription()

Description

 

Suppresses automatic descriptive text generation for this textbox. Only the description specified via textbox.description appears in this textbox's text description.

 

method

 

suppressDescriptionItem

Syntax

 

textbox.suppressDescriptionItem(itemtype)

Description

 

Suppresses descriptive text generation for the specified item types in this textbox object. suppressDescriptionItem currently suppresses text descriptions for drilldown effects.

Parameters

 

graph.suppressDescriptionItem accepts the following parameters:

 

 

itemtype

{ _TextDrilldown_}

 

 

The item type that you want to suppress descriptive text for. Choose _TextDrilldown_ to suppress descriptive text for drilldown effects on category labels. Choose _Drilldown_ to suppress descriptive text for all drilldown effects.

Example

 

textbox.suppressDescriptionItem Method

textbox.suppressDescriptionItem(_TextDrilldown_)