BannerTile Class Methods

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

Syntax

ApplyVisuals()

Description

You must invoke the ApplyVisuals method in the page Activate program for the dashboard header page to ensure that dashboard header component is displayed properly on all form factors.

Important! Usage of this method is required.

Parameters

None.

Returns

None.

Syntax

BannerTile(&homepage_ID)

Description

Use the BannerTile constructor method to instantiate an object of the superclass. In your implementation, the constructor method for your custom application class must invoke this method to instantiate an object of the superclass.

Parameters

Field or Control

Definition

&homepage_ID

Specifies the homepage ID for the fluid dashboard definition. This value, returned by the Request object, is used to instantiate an object of your custom application class, and then is passed to the superclass.

Returns

A BannerTile object.

Example

In the following example, the constructor method of the MyBannerComp class instantiates an object of the BannerTile superclass:

method MyBannerComp
   /+ &hp_ID as String +/
   %Super = create PTNUI:Banner:BannerTile(&hp_ID);
   %This.AnnounceText = "One or more tiles has been updated.";
   rem %This.IsPersistContext = False;
end-method;

Syntax

ClearContextString()

Description

Note: This method has been deprecated. Use the DeleteContext, DeleteContextAndUpdate, or DeleteKey methods instead.

Parameters

None.

Returns

None.

Syntax

DeleteContext()

Description

Use the DeleteContext method to delete all context keys and context values from memory. Only invoke this method if IsPersistContext is True.

Note: You must separately and explicitly update both the context for the tiles on the dashboard as well as the context fields displayed to the user.

Parameters

None.

Returns

None.

Syntax

DeleteContextAndUpdate()

Description

Use the DeleteContextAndUpdate method to delete all context keys and context values from memory and then update the tiles on the dashboard to reflect this change. Only invoke this method if IsPersistContext is True. For example, invoke DeleteContextAndUpdate in a FieldChange program associated with a Clear button to clear the context and update the dashboard and its tiles.

Note: You must separately and explicitly update the context fields displayed to the user.

Parameters

None.

Returns

None.

Example

import MYPKG:MyBannerComp;

Component MYPKG:MyBannerComp &oBanner;

/* Clears the context keys and values and updates the tiles. */
&oBanner.DeleteContextAndUpdate();

/* Clears the values displayed to the user. */
MY_REC.SETID.Value = "";
MY_REC.DESCR.Value = "";

Syntax

DeleteKey(KEYNAME)

Description

Use the DeleteKey method to delete an individual context key and value from memory by specifying the key’s name. Only invoke this method if IsPersistContext is True.

Parameters

Field or Control

Definition

KEYNAME

Specifies the name of the key as a string value.

Returns

None.

Example

If &oBanner.IsKeyExist("SETID") Then
   &oBanner.DeleteKey("SETID");
End-If;

Syntax

GetBannerLabel()

Description

Override the GetBannerLabel method to set and return a label for the dashboard header component. Because this label is used for accessibility purposes, never set the label to an empty string.

Note: The default label is: Dashboard Header.

Important! Do not explicitly invoke this method. It will be invoked by the PeopleSoft system as necessary.

Parameters

None.

Returns

A string value.

Example

The following implementation of GetBannerLabel overrides the base class implementation.

method GetBannerLabel
   /+ Returns String +/
   /+ Extends/implements PTNUI:Banner:BannerTile.GetBannerLabel +/
   Return "My Dashboard: Contextual Data Area";
end-method;

Syntax

GetContextString()

Description

Use the GetContextString method to return the context string as query string parameters. The following example demonstrates the string returned when two context keys are defined:

SETID=DFLTSET&CURRENCY=USD

Parameters

None.

Returns

A string value.

Example

&cxt_str = &oBanner.GetContextString();

Syntax

GetGroupletURL()

Description

You must provide an implementation of the GetGroupletURL abstract method. In your implementation, return the URL to the dashboard header component as a string value.

Important! Do not explicitly invoke this method. It will be invoked by the PeopleSoft system as necessary.

Parameters

None.

Returns

A string value.

Example

The following example shows an implementation of GetGroupletURL that uses the GenerateComponentContentURL built-in PeopleCode function to generate the URL string.

method GetGroupletURL
   /+ Returns String +/
   /+ Extends/implements PTNUI:Banner:BannerTile.GetGroupletURL +/
   Local string &url = GenerateComponentContentURL(%Portal, %Node, MenuName.MY_MENU, "GBL", Component.MY_DRIVERCOMP, "", "");
   Return &url;
end-method;

Syntax

GetKeyValue(KEYNAME)

Description

Use the GetKeyValue method to return a string value representing the key value associated with the specified key.

Parameters

Field or Control

Definition

KEYNAME

Specifies the name of the key as a string value.

Returns

A string value.

Syntax

IsKeyExist(KEYNAME)

Description

Use the IsKeyExist method to return a boolean value indicating whether the specified key name exists.

Parameters

Field or Control

Definition

KEYNAME

Specifies the name of the key as a string value.

Returns

A boolean value.

Example

If &oBanner.IsKeyExist("SETID") Then
   &oBanner.DeleteKey("SETID");
End-If;

Syntax

SetDefaultContext()

Description

Override the SetDefaultContext method to set the initial context keys and values for the dashboard header component.

Note: If the IsPersistContext property is set to False in the constructor method of your custom application class, the default context keys and values are still propagated to the tiles on the dashboard. However, these keys and values are not retained in memory.

Important! Do not explicitly invoke this method. It will be invoked by the PeopleSoft system as necessary.

Parameters

None.

Returns

None.

Example

The following example demonstrates how to override the SetDefaultContext method within your custom application class.

method SetDefaultContext
   /+ Extends/implements PTNUI:Banner:BannerTile.SetDefaultContext +/
   %This.SetKeyValue("SETID", "AUS01");
   %This.SetKeyValue("DESCR", "Default description");
end-method;

Syntax

SetKeyValue(KEYNAME, KEYVALUE)

Description

Use the SetKeyValue method to set a context key name and value pair.

Parameters

Field or Control

Definition

KEYNAME

Specifies the name of the context key as a string value.

KEYVALUE

Specifies the context value as a string value.

Returns

None.

Example

%This.SetKeyValue("SETID", "DFLTSET");

Syntax

UpdateContext()

Description

Use the UpdateContext method to pass the defined context keys and values from the dashboard header component to the tiles on the fluid dashboard. For example, invoke UpdateContext in a FieldChange program to pass user-supplied values to the tiles.

Parameters

None.

Returns

None.

Example

import MYPKG:MyBannerComp;

Component MYPKG:MyBannerComp &oBanner;

&oBanner.SetKeyValue("SETID", GetField(MY_REC.SETID).Value);
&oBanner.SetKeyValue("DESCR", GetField(MY_REC.DESCR).Value);

&oBanner.UpdateContext()