Work with Modals

The following are Apex classes to work with modals.

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

Return Value

Type: Slack.ModalView


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

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.

ModalView.Builder Methods

The following are methods for ModalView.Builder.

build()

Returns an instance of the Slack.ModalView object.

Signature

Return Value

Type: Slack.ModalView

clearOnClose(clearOnClose)

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

externalId(externalId)

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

viewReference(viewReference)

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