DynamicPickList Class

An abstract class, used to display the values of a picklist in a Lightning component on a Lightning page.

VisualEditor

To use this class as the datasource of a picklist in a Lightning component, it must be extended by a custom Apex class and then that class must be called in the component’s design file.

Here’s an example of a custom Apex class extending the VisualEditor.DynamicPickList class.

Here’s an example of how the custom Apex class gets called in a design file so that the picklist appears in the Lightning component.

The following are methods for DynamicPickList.

  • clone()

    Makes a duplicate copy of the VisualEditor.DynamicPicklist object.

  • getDefaultValue()

    Returns the picklist item that is set as the default value for the picklist.

  • getLabel(attributeValue)

    Returns the user-facing label for a specified picklist value.

  • getValues()

    Returns the list of picklist item values.

  • isValid(attributeValue)

    Returns the valid state of the picklist item’s value. A picklist value is considered valid if it’s a part of any VisualEditor.DataRow in the VisualEditor.DynamicPickListRows returned by getValues().

Makes a duplicate copy of the VisualEditor.DynamicPicklist object.

public Object clone()

Type: Object

Returns the picklist item that is set as the default value for the picklist.

public VisualEditor.DataRow getDefaultValue()

Type: VisualEditor.DataRow

Returns the user-facing label for a specified picklist value.

public String getLabel(Object attributeValue)

  • attributeValue: Type: Object The value of the picklist item.

Type: String

Returns the list of picklist item values.

public VisualEditor.DynamicPickListRows getValues()

Type: VisualEditor.DynamicPickListRows

Returns the valid state of the picklist item’s value. A picklist value is considered valid if it’s a part of any VisualEditor.DataRow in the VisualEditor.DynamicPickListRows returned by getValues().

public Boolean isValid(Object attributeValue)

  • attributeValue: Type: Object The value of the picklist item.

Type: Boolean