Creating a Custom Application Class
The custom application class that you implement has a one-to-one relationship to your dashboard header component. The dashboard header page must instantiate an object of this class in the page’s Activate event. Note the following design considerations for your custom application class:
-
Your class implements the PTNUI:Banner:BannerTile base class. Use the
implementskeyword, notextends. -
The constructor method of your class must call PeopleCode API Reference: BannerTile method: BannerTile class to instantiate the superclass by passing the dashboard ID. In your constructor, you can optionally:
-
Set the PeopleCode API Reference: AnnounceText property: BannerTile class property.
-
Set the PeopleCode API Reference: IsPersistContext property: BannerTile class property only if you do not wish to persist the context data.
-
-
You must implement the PeopleCode API Reference: GetGroupletURL method: BannerTile class abstract method to return the URL to the dashboard header component. The following example demonstrates the recommended approach using the GenerateComponentContentURL built-in function.
-
Oracle recommends that you implement (override) the PeopleCode API Reference: GetBannerLabel method: BannerTile class method to set a label for the dashboard header component for accessibility purposes only.
-
Optionally, implement (override) the PeopleCode API Reference: SetDefaultContext method: BannerTile class method to set default context values, possibly from persistent storage.
-
Optionally, implement (override) the PeopleCode API Reference: OverrideDefaultProperties method: BannerTile class method to override the default setting for certain properties—for example, the IsExpanded property.
The following example provides a simple implementation of PTNUI:Banner:BannerTile:
import PTNUI:Banner:BannerTile;
class MyBannerComp implements PTNUI:Banner:BannerTile
method MyBannerComp(&hp_ID As string);
method GetGroupletURL() Returns string;
method SetDefaultContext();
method GetBannerLabel() Returns string;
end-class;
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;
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;
method SetDefaultContext
/+ Extends/implements PTNUI:Banner:BannerTile.SetDefaultContext +/
%This.SetKeyValue("SETID", "AUS01");
%This.SetKeyValue("DESCR", "Default description");
end-method;
method GetBannerLabel
/+ Returns String +/
/+ Extends/implements PTNUI:Banner:BannerTile.GetBannerLabel +/
Return "My Dashboard: Contextual Data Area";
end-method;WARNING:
Do not clone or copy PTNUI:Banner:DefaultBannerTile to create your custom application class.