Tile Class Methods

In this section, the Tile class methods are presented in alphabetical order.

Syntax

getAmountFormattedValue(num_val, currency_cd)

Description

Invoke the getAmountFormattedValue method to return a String value that represents a numeric value that has been formatted with the currency symbol corresponding to the specified currency code.

Parameters

Field or Control

Definition

num_val

Specifies the numeric value to be formatted as a Number value.

currency_cd

Specifies the currency code as a String value.

Returns

A String value.

Example

&total = &sub_tot1 + &sub_tot2:
%This.TileKPI_1 = %This.getAmountFormattedValue(&total, "USD");

Syntax

getTileLiveData()

Description

This abstract method in the base class must be implemented in the subclass. In your implementation, you must set all properties required for the specified content type.

In addition, your implementation can include optional method invocations to dynamically override whether live data is displayed, whether a badge is displayed, or even the tile content type (by invoking one of the SetTileContentAs* methods).

Parameters

None.

Returns

None.

Example

method getTileLiveData
   /+ Extends/implements PTGP_APPCLASS_TILE:Tiles:Tile.getTileLiveData +/
   Local string &title, &img;
   SQLExec("Select DESCR, PTGPLT_IMAGE FROM PS_PTPPB_GROUPLET Where PTPPB_GROUPLET_ID = :1", %This.TileID, &title, &img);

   %This.ImageReferenceField.Value = @("Image." | &img);
   %This.TileImageReferenceLabel = &title;

end-method;

Syntax

SetTileContentAsChart()

Description

Invoke the SetTileContentAsChart method within your implementation of the getTileLiveData method only if you wish to dynamically override the tile content type to display a chart at runtime.

If you invoke this method, then the Tilechart property is required.

Parameters

None.

Returns

None.

Syntax

SetTileContentAsChartAndKPI()

Description

Invoke the SetTileContentAsChartAndKPI method within your implementation of the getTileLiveData method only if you wish to dynamically override the tile content type to display a chart and key performance indicator (KPI) at runtime.

If you invoke this method, then the Tilechart, TileKPI_1, and TileKPI_1_Label properties are required.

Parameters

None.

Returns

None.

Syntax

SetTileContentAsHTML()

Description

Invoke the SetTileContentAsHTML method within your implementation of the getTileLiveData method only if you wish to dynamically override the tile content type to display an HTML area at runtime.

If you invoke this method, then the TileHtmlArea property is required; the TileHtmlAreaStyle property is optional.

Parameters

None

Returns

None.

Syntax

SetTileContentAsImage()

Description

Invoke the SetTileContentAsImage method within your implementation of the getTileLiveData method only if you wish to dynamically override the tile content type to display an image at runtime. When the tile content is specified to be an image, either setTileImageRef method or the ImageReferenceField property is required.

Parameters

None.

Returns

None.

Syntax

SetTileContentAsOneKPI()

Description

Invoke the SetTileContentAsOneKPI method within your implementation of the getTileLiveData method only if you wish to dynamically override the tile content type to display one KPI at runtime.

If you invoke this method, then the TileKPI_1 and TileKPI_1_Label properties are required.

Parameters

None.

Returns

None.

Syntax

SetTileContentAsTwoKPIs()

Description

Invoke the SetTileContentAsTwoKPIs method within your implementation of the getTileLiveData method only if you wish to dynamically override the tile content type to display two KPIs at runtime. With this method, the KPI data will be displayed side-by-side on the tile, rather than stacked. As an alternative, you can set the TileKPI_2_Layout property to change the orientation of the KPI data after invoking the SetTileContentAsTwoKPIs method.

If you invoke this method, then the TileKPI_1, TileKPI_1_Label, TileKPI_2, and TileKPI_2_Label properties are required.

Parameters

None.

Returns

None.

Syntax

SetTileContentAsTwoKPIsTopBottom()

Description

Invoke the SetTileContentAsTwoKPIsTopBottom method within your implementation of the getTileLiveData method only if you wish to dynamically override the tile content type to display two KPIs at runtime. With this method, the KPI data will be stacked on the tile, rather than side-by-side.

If you invoke this method, then the TileKPI_1, TileKPI_1_Label, TileKPI_2, and TileKPI_2_Label properties are required.

Parameters

None.

Returns

None.

Description

Instead of setTileContentOption, use one of the SetTileContentAs* methods to set the tile content type.

Syntax

setTileHasCount(badge_display)

Description

Invoke the setTileHasCount method within your implementation only if you wish to dynamically override whether the badge area is enabled (that is, whether badge data is displayed). Invoking this method is equivalent to setting the hasLiveDataCount property. If the badge is enabled, you must also set the badge data with the TileTransCount property.

Parameters

Field or Control

Definition

badge_display

Specify a String value:

  • Y - Indicates that the badge area is enabled for this tile.

  • N - Indicates that the badge area is disabled for this tile.

Returns

None.

Example

%This.setTileHasCount("Y"); /* Enables the badge area. */
%This.TileTransCount = MY_REC.COUNT;

Syntax

setTileID(Tile_ID)

Description

Invoke the setTileID method within your implementation only if you wish to dynamically override the ID specified for this tile at runtime.

Parameters

Field or Control

Definition

Tile_ID

Specifies the new tile ID as a String value.

Returns

None.

Syntax

setTileImageRef(image_name)

Description

Invoke the setTileImageRef method to specify the image to be displayed when the tile's content type is specified as an image. Invoking this method is equivalent to specifying a value for the ImageReferenceField property. When the tile content is specified to be an image, either this method or the ImageReferenceField property is required.

Parameters

Field or Control

Definition

image_name

Specifies the image ID as a String value.

Returns

None.

Example

REM %This.ImageReferenceField.Value = Image.PTFP_DEFAULT_CLOUD;  /* Property equivalent */

%This.setTileImageRef("PTFP_DEFAULT_CLOUD");
%This.TileImageReferenceLabel("My tooltip");

Syntax

setTileLiveData(livedata_display)

Description

Invoke the setTileLiveData method within your implementation only if you wish to dynamically override whether the live data area is enabled (that is, whether live data is displayed). Invoking this method is equivalent to setting the hasLiveDataDescr property. If live data is enabled, you must also specify one or more live data values with the TileLiveData_1, TrendImage, TileLiveData_2, and TileLiveData_3 properties.

Parameters

Field or Control

Definition

livedata_display

Specify a String value:

  • Y - Indicates that the live data area is enabled for this tile.

  • N - Indicates that the live data area is disabled for this tile.

Returns

None.

Example

%This.setTileLiveData("Y"); /* Enables the live data area. */

%This.TileLiveData_1 = "Value 1";
%This.hasLivedataTrendImage = True; /* Optional trend image */
%This.TrendImage = %This.k_strTrendUpImage; 
%This.TileLiveData_2 = "Value 2";
%This.TileLiveData_3 = "Value 3";

Syntax

Tile()

Description

The Tile method is the constructor for the superclass. In your implementation, the constructor for your subclass must instantiate an object of the superclass using %Super.

Parameters

None

Returns

None.

Example

method My_Tile
   %Super = create PTGP_APPCLASS_TILE:Tiles:Tile();
end-method;