Work with Modals

The following are Apex classes to work with modals.

ModalHandler Interface

Implement this interface to return a modal view.

ModalHandler Methods

ModalHandler has the following method.

call()

Enables you to create an instance of modal view with the view reference parameters.

Signature

public Slack.ModalView call()

Return Value

Type: Slack.ModalView


ModalView Class

Creates a modal view. A view is a visual area within a modal. See Defining view objects.

ModalView Methods

The following are methods for ModalView.

builder()

Builds a request object that's used when executing the API call.

Signature

public static Slack.ModalView.Builder builder()

Return Value

Type: Slack.ModalView.Builder


ModalView.Builder Class

Contains methods to build an instance of the Slack.ModalView class.

A Builder object is obtained by invoking one of the ModalView.Builder methods defined by the ModalView class.

ModalView.Builder Methods

The following are methods for ModalView.Builder.

build()

Returns an instance of the Slack.ModalView object.

Signature

public Slack.ModalView build()

Return Value

Type: Slack.ModalView

clearOnClose(clearOnClose)

Sets the clearOnClose boolean value on the modal view object.

Signature

public Slack.ModalView.Builder clearOnClose(Boolean clearOnClose)

Parameters

clearOnClose

Specifies whether clicking on the close button clears all views in a modal and closes it. This value defaults to false.

Type: Boolean

Return Value

Type: Slack.ModalView.Builder

externalId(externalId)

Sets the externalId value on the modal view object.

Signature

public Slack.ModalView.Builder externalId(String externalId)

Parameters

externalId

Type: String

A custom identifier that must be unique for all views on a per-team basis.

Return Value

Type:Slack.ModalView.Builder

viewReference(viewReference)

Sets the view to be displayed in the modal.

Signature

public Slack.ModalView.Builder viewReference(Slack.ViewReference viewReference)

Parameters

viewReference

Type: Slack.ViewReference

The view to be displayed in the modal.

Return Value

Type: Slack.ModalView.Builder