Navigate with a fresh model¶
A variant of Navigate to a view that first builds an entirely new model and view-data instance — used when a screen needs to open a logically independent window (for example, a second claim window) rather than reuse the current model.
| Field | Value |
|---|---|
| Operation ID | OP-MVC-04b |
| Trigger | Derived controller opens a new logical window/instance under multi-model support |
| Inputs | SupportsMultiModel, factory-built model, current ViewData |
| Outputs | New model/view data stored under a new GUID in session; delegates to Navigate |
| Primary components | clsControllerBase.Navigate2 |
| Entry point | SAIF.Presentation.Web.MVC/clsControllerBase.vb |
Steps¶
- If
SupportsMultiModelis false, throwApplicationException("Navigate2 only supported with Multiple Model configuration.")(BR-MVC-011). - On failure: exception propagates to the caller — no model/context is created.
- Build a new model from the factory, assign a new
clsSecurityPrincipal(Platform.Web)and the application name, and callPre_Init(). - Call the overridable
OnNewModel(newModel, newViewData). - If it returns
False: abandon the navigation and returnFalse— no session state is written and Navigate is not called. - Copy all current
ViewDataentries into the new view data, callnewModel.UnInitialize(), and store both under a new GUID (<guid>-model,<guid>-viewdata) in session (BR-MVC-008). - Delegate to
Navigate(...)passing the new GUID asinNewModel. - Embeds Navigate to a view, including its cross-application context persistence to Context via SQL-001.
Origin: Step 5 is implemented in
Navigate to a view(clsControllerBase.Navigate, this library) and executed on behalf of this operation.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Navigate2 called]) --> D1{SupportsMultiModel?}
D1 -->|No| EndErr([Throw ApplicationException])
D1 -->|Yes| S1[Build new model, new SecurityPrincipal, Pre_Init]
S1 --> S2[OnNewModel]
S2 --> D2{Returned False?}
D2 -->|Yes| EndAbandon([Return False])
D2 -->|No| S3[Copy ViewData, UnInitialize old, store under new GUID]
S3 --> S4[Delegate to Navigate]
S4 --> EndOk([Navigate result returned])
Failure and edge-case behavior¶
- Calling this operation without multi-model support enabled is a hard configuration error (
ApplicationException), not a silent no-op. - A derived
OnNewModeloverride can veto the navigation entirely by returningFalse, before any session state changes are made.
Related documentation¶
Sources¶
- SAIF.Presentation.Web.MVC/clsControllerBase.vb