---
title: Handle a toolbar click
summary: Map a clicked toolbar icon to its logical `ToolBarButton` action and raise the corresponding event(s) for the host page.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Controls.V2.Menu
reference_type: package
operation_id: OP-MENU-016
trigger: "`SAIFMenuTop.MenuImage_Click`, the `Click` event of a toolbar `SAIFImageButton`."
---

# Handle a toolbar click

Map a clicked toolbar icon to its logical `ToolBarButton` action and raise the corresponding event(s) for the host page. This operation is implemented by `SAIFMenuTop.MenuImage_Click`.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-MENU-016 |
| **Trigger** | `SAIFMenuTop.MenuImage_Click`, the `Click` event of a toolbar `SAIFImageButton`. |
| **Inputs** | Clicked control's `ID`. |
| **Outputs** | `ToolbarClick(ToolBarButton)`; `DefaultOnSubmit()`; `MenuNavigate("", "Help")` (help icon only). |
| **Primary components** | `SAIFMenuTop.MenuImage_Click` |
| **Entry point** | `SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenuTop.vb` |

## Steps

1. Map the clicked icon ID to the matching `ToolBarButton` value and raise `ToolbarClick`. Enforces [BR-MENU-075](../business-rules.md#br-menu-075-each-toolbar-icon-maps-to-exactly-one-toolbarbutton-value).
2. `imgTopDefaultOnSubmit` raises `DefaultOnSubmit()` instead. Enforces [BR-MENU-050](../business-rules.md#br-menu-050-the-hidden-default-submit-button-raises-defaultonsubmit).
3. `mnuHelp` raises both `ToolbarClick(Help)` and `MenuNavigate("", "Help")`. Enforces [BR-MENU-076](../business-rules.md#br-menu-076-the-help-icon-raises-both-toolbarclickhelp-and-menunavigate).
4. - Note: visibility/enabled guards around each toolbar event are present only as commented-out code and are therefore not enforced — a click on a disabled-but-rendered icon still raises the event. Enforces [BR-MENU-077](../business-rules.md#br-menu-077-toolbar-click-handling-does-not-re-check-visibility-or-enabled-state).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["SAIFMenuTop.MenuImage_Click, the Click event"]) --> Which{Which icon?}
	Which -->|Standard toolbar icon| Map["Map icon ID to ToolBarButton value"]
	Map --> RaiseClick(["Raise ToolbarClick(ToolBarButton)"])
	Which -->|imgTopDefaultOnSubmit| Default(["Raise DefaultOnSubmit()"])
	Which -->|mnuHelp| Help(["Raise ToolbarClick(Help) and MenuNavigate(&quot;&quot;, &quot;Help&quot;)"])
	RaiseClick --> NoGuard(["No visibility/enabled re-check; guards are commented out"])
```

## Failure and edge-case behavior

- A postback targeting a hidden/disabled toolbar icon still raises its event; the handler performs no server-side re-validation ([BR-MENU-077](../business-rules.md#br-menu-077-toolbar-click-handling-does-not-re-check-visibility-or-enabled-state)).

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenuTop.vb`
