Work with Modals

The following are Apex classes to work with modals.

Implement this interface to return a modal view.

ModalHandler has the following method.

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

Signature

Return Value

Type: Slack.ModalView


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

The following are methods for ModalView.

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

Signature

Return Value

Type: Slack.ModalView.Builder


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.

The following are methods for ModalView.Builder.

Returns an instance of the Slack.ModalView object.

Signature

Return Value

Type: Slack.ModalView

Sets the clearOnClose boolean value on the modal view object.

Signature

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

Sets the externalId value on the modal view object.

Signature

Parameters

externalId

Type: String

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

Return Value

Type.ModalView.Builder

Sets the view to be displayed in the modal.

Signature

Parameters

viewReference

Type: Slack.ViewReference

The view to be displayed in the modal.

Return Value

Type: Slack.ModalView.Builder