OnNavigating - cWebView
Sent as part of the navigation process when navigating into a view or the view being navigated into
Type: Event
Parameters
| Parameter | Type | Description |
|---|---|---|
| ByRef NavigateData | tWebNavigateData | Filled navigation data struct, passed by reference so it can be altered. |
| hoInvokingView | Handle | Object handle of the invoking view |
| hoInvokingObject | Handle | Object handle of the invoking object |
| ByRef bCancel | Boolean | Set to True to cancel the navigation. |
Syntax
Procedure OnNavigating ByRef tWebNavigateData NavigateData Handle hoInvokingView Handle hoInvokingObject ByRef Boolean bCancel
Description
This message is sent as part of the navigation process when navigating into a view or the view being navigated into. It is only sent when navigating forward (NavigateForward / NavigateBegin / NavigatePath / NavigateForwardCustom) and when deep link is opened. This message is sent when all navigation details are determined but before the navigation is actually performed. It provides the last chance to alter the navigation data or to cancel the navigation.
Note that the view is not yet initialized and likely is not in sync (so using client web properties inside the view is not possible).
Sample
This sample shows how to cancel the navigation based on certain conditions determined by the navigation data.
Procedure OnNavigating tWebNavigateData ByRef NavigateData Handle hoInvokingView Handle hoInvokingObject Boolean ByRef bCancel
If (hoInvokingView = oSelectOrdersByCustomer) Begin
Send FindByRowId of oCustomerDataDictionary (RefTable(Customer)) (DeserializeRowID(NavigateData.sRowID))
If (Customer.Name contains "America") Begin
Move True to bCancel
Send UserError "American customers shouldn't be edited!"
End
End
End_Procedure