GraffitiAlert

View Categories

Enumerations #

NameValues
MessagePositionsTop
TopLeft
TopCenter
TopRight
Center
CenterLeft
CenterRight
Bottom
BottomLeft
BottomCenter
BottomRight

Constants #

This class exposes no constants.

Events #

NameParametersReturn TypeDescription
ButtonClickedtheMessage as GraffitiWebAlertMessage
theButton as GraffitiWebAlertButton
NoneRaised when the user has clicked one of the defined buttons.
MessageClosedtheMessage as GraffitiWebAlertMessage NoneRaised when an alert has been closed.
MessageShowntheMessage as GraffitiWebAlertMessage NoneRaise when an alert has been shown.

Methods #

NameParametersReturn TypeDescription
CloseAllNoneNoneCloses all currently open messages.
CloseMessagetheMessage as GraffitiWebAlertMessage NoneCloses the specified message.
CloseMessagemessageName as StringNoneCloses the message whose name matches messageName.
ShowtheMessage as GraffitiWebAlertMessageNoneShows the specified message.

Properties #

NameTypeDefault ValueDescription
ForceZIndexBooleanFalseWhen True, the alert controller will automatically calculate the correct z-index to keep GraffitiAlertMessages above all other controls on the page, MessageBoxes, WebDialogs, etc.

Notes #

Multiple Alerts #

The underlying library does not support stacking along the z axis. If you find yourself needing to do this, you may need to reevaluate your design as this can be confusing for users (just as showing many MessageBoxes or DesktopWindow modals may be a problem). A potential solution may be to use a PagePanel to show alternate content within the primary alert and react accordingly to button presses based on the state of the container.

Examples #

Handling Button Clicks #

GraffitiAlert has an event for catching when GraffitiAlertButtons are clicked on the GraffitiAlertMessage instance.

A typical implementation may look like this:

Sub ButtonClick(theMessage as GraffitiAlertMessage, theButton as GraffitiAlertButton) Handles ButtonClick
  select case theMesage.Name
  case "yesNo"
    if theButton.Name = "yes" then
      ' User clicked yes.
    else
      ' User clicked no.
    end if
  case "yesNoCancel"
    if theButton.Name = "yes" then
      ' User clicked yes.
    elseif theButton.Name = "no" then
      ' User clicked no.
    else
      ' User clicked cancel.
    end if
  end select
End Sub