DesignTimePageContext Class

A class that provides context information about a Lightning page. It can be used to help define the values of a picklist in a Lightning component on a Lightning page based on the page’s type and the object with which it’s associated.

VisualEditor

To use this class, create a parameterized constructor in the custom Apex class that extends VisualEditor.DynamicPickList.

Here’s an example of a custom Apex class extending the VisualEditor.DynamicPickList class. It includes VisualEditor.DesignTimePageContext to define a picklist value that is available only if the page type is HomePage.

The following are properties for DesignTimePageContext.

  • entityName

    The API name of the sObject that a Lightning page is associated with, such as Account, Contact, or Custom_object__c. entityName is available only for object pages, and not all Lightning pages are associated with objects.

  • pageType

    The type of Lightning page, such as HomePage, AppPage, or RecordPage.

The API name of the sObject that a Lightning page is associated with, such as Account, Contact, or Custom_object__c. entityName is available only for object pages, and not all Lightning pages are associated with objects.

public String entityName {get; set;}

Type: String

The type of Lightning page, such as HomePage, AppPage, or RecordPage.

public String pageType {get; set;}

Type: String

The following are methods for DesignTimePageContext.

  • clone()

    Makes a duplicate copy of the VisualEditor.DesignTimePageContext object.

Makes a duplicate copy of the VisualEditor.DesignTimePageContext object.

public Object clone()

Type: Object