asAlert

fun ComponentValidationMessage.asAlert(    styling: BasicParams.() -> Unit = { },     renderContext: RenderContext,     build: AlertComponent.() -> Unit = { })

Convenience extension function to display a ComponentValidationMessage as an alert.

The alert's severity and content are determined from the validation message's properties. Custom styling via the styling parameter is optionally supported, as well as any other customization via the build-lambda.

Usage example:

val message = infoMessage("SomeId", "This is a simple info message.")

// within some `RenderContext` so `this` refers to it
message.asAlert(this)

See also

Parameters

renderContext

RenderContext to render the alert in

styling

a lambda expression for declaring the styling of the toast using fritz2's styling DSL

build

a lambda expression for setting up the component itself


fun ComponentValidationMessage.asAlert(renderContext: RenderContext, build: AlertComponent.() -> Unit = { })

Convenience extension to display a ComponentValidationMessage as an alert.

The alert's severity and content are determined from the validation message's properties. Customization of the underlying AlertComponent is supported via the build-lambda.

This variant does not offer custom styling. The latter can be applied via the overloaded ComponentValidationMessage.asAlert method.

Usage example:

val message = infoMessage("SomeId", "This is a simple info message.")

// within some `RenderContext` so `this` refers to it
message.asAlert(this)

See also

Parameters

renderContext

RenderContext to render the alert in

build

a lambda expression for setting up the component itself