Present the context search box¶
Render and manage the context search textbox, including its watermark/placeholder behaviour and change notification. This operation is implemented by SAIFMenu.InitializeControls, SAIFMenu.ContextValue.
| Field | Value |
|---|---|
| Operation ID | OP-MENU-003 |
| Trigger | SAIFMenu.InitializeControls, invoked from CreateControls during OnLoad; property access on ContextValue. |
| Inputs | ContextViewStyle, ContextLabel, UpperCaseContextValue, posted textbox value. |
| Outputs | Rendered context textbox; ContextValue property; OnContextChanged event. |
| Primary components | SAIFMenu.InitializeControls, SAIFMenu.ContextValue |
| Entry point | SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenu.vb |
Steps¶
- Apply the
ContextViewStyle:Normalshows an editable box,Read_Onlyshows a read-only box,Hiddenhides it. Enforces BR-MENU-011. - In
Normalmode with an empty value and a non-emptyContextLabel, display the label as watermark text styledwatermark. Enforces BR-MENU-012. - Attach
OnFocus/OnBlurhandlers passing the label (with single quotes escaped) to the watermark scripts. Enforces BR-MENU-013, BR-MENU-014. - Reading
ContextValuereturnsString.Emptywhen the box still contains the watermark label, and upper-cases the value whenUpperCaseContextValueis set. Enforces BR-MENU-015, BR-MENU-016. - Setting
ContextValuetrims (and optionally upper-cases) the value and raisesOnContextChangedwith the old and new values. Enforces BR-MENU-017.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start(["SAIFMenu.InitializeControls"]) --> Style{ContextViewStyle?}
Style -->|Normal| Editable["Show editable box"]
Style -->|Read_Only| ReadOnly["Show read-only box"]
Style -->|Hidden| Hide["Hide the box"]
Editable --> Empty{Value empty and ContextLabel set?}
Empty -->|Yes| Watermark["Display label as watermark text"]
Watermark --> Handlers["Attach OnFocus/OnBlur watermark handlers, escaping quotes"]
Handlers --> Read["ContextValue read: empty when showing watermark, upper-cased if configured"]
Read --> SetValue["ContextValue set: trim/upper-case, raise OnContextChanged"]
SetValue --> End(["Rendered context textbox with ContextValue property"])
Empty -->|No| Read
Failure and edge-case behavior¶
- A
ContextLabelcontaining characters other than a single quote is emitted into the inline script unescaped (BR-MENU-014).
Related documentation¶
Sources¶
SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenu.vb