Class Alert

java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.components.display.Alert
All Implemented Interfaces:
Component

public class Alert extends HtmlTag
Alert message component with severity style variants.

Severity controls styling only; this component does not assign a role or live-region announcement policy. Application-supplied attributes are retained.

Mutable and not thread-safe while being configured. Finish configuration before sharing a stable structure or compiling a template; use slots/context for per-request values.

  • Constructor Details

  • Method Details

    • info

      public static Alert info(String message)
    • success

      public static Alert success(String message)
    • warning

      public static Alert warning(String message)
    • danger

      public static Alert danger(String message)
    • dismissible

      public Alert dismissible()
      Configures one native, non-submit close button named Dismiss alert. Repeated calls retain the dismissible class without adding another control.

      Load /css/framework.css and /js/framework.js once in the page shell. Native activation hides the nearest usable dismissible alert with hidden; the DOM is retained and dismissal is not persisted. Cancelled, disabled, unavailable or covered-modal controls do not dismiss an alert. Later inserted alerts need no reinitialization.

      If the alert held focus, an application-selected replacement is respected. In the top Modal, focus stays within that dialog. On ordinary pages, surviving containing elements are tried with native focus first; only an absent tabindex may be borrowed as -1 while focus needs it. Caller attributes, including malformed values and later same-value writes, are not overwritten or removed. Borrowed state is released on blur, failed focus or disconnection and can be restored when that containing element was a modal opener.

      Custom themes/layouts, application focus flows and role/live-region semantics remain application responsibilities.

      Returns:
      this alert
    • withClass

      public Alert withClass(String className)
      Description copied from class: HtmlTag
      Overrides:
      withClass in class HtmlTag