The tWebNavigateData Struct
Understanding Navigation
The Forward Navigation Process
The tWebNavigateData struct is used to pass information forward or back from one view to another in the view stack. When you navigate forward, most of this data is initialized for you by the framework. The framework uses this to define standard navigation initializations and behaviors for the view being displayed. It is also used by the developer to handle customizations. The newly displayed view stores this data in a private web property. This data can be accessed using GetNavigateData and SetNavigateData. During a navigate back operation, the data is passed back to the invoking view so it can be used to update any changes.
Definition
The tWebNavigateData struct is defined as follows:
Struct tWebNavigateData
Integer eNavigateType
Integer iTable
Integer iColumn
String sRowID
Boolean bNewRecord
Boolean bReadOnly
Boolean bSaveBeforeNavigate
tNameValuePair[] NamedValues
End_Struct
Members
-
eNavigateType
This contains the navigate-from type. WhenNavigateForwardis sent, this type is determined for you and is then moved to this member. Valid values arenfFromMain,nfFromChild,nfFromParent, andnfUndefined. -
iTable
This is the table number associated with the invoking object that started the navigate forward process. If the value is non-zero, it is expected that there will be a DDO in the view for this table. If the invoking object is data bindable (i.e., if it supports theEntry_Itemsyntax), this table value will be used here. If it is not data bindable, theMain_Filevalue of the invoking view’s DDO Server is used. This is usually maintained by the framework. -
iColumn
This is the table column number associated with the invoking object that started the navigate forward process. If the invoking object is data bindable (i.e., if it supports theEntry_Itemsyntax), this bound column value will be used here. If it is not data bindable, it will be 0. This is usually maintained by the framework. -
sRowID
During forward navigation, this is set to a serialized version of theRowIDassociated withiTable. During back navigation, this will be set to theRowIDof the view being closed. This is usually maintained by the framework. -
bNewRecord
During forward navigation, the developer can set this toTrueto indicate that the view being navigated to will be cleared for new data entry. Normally, this would be set inOnGetNavigateForwardDatawhen moving from a Select view to a Zoom view. -
bReadOnly
During forward navigation, the developer can set this toTrueto indicate that the view being navigated should be read-only. Normally, this would be set inOnGetNavigateForwardDatawhen moving from a Select view to a Zoom view. -
bSaveBeforeNavigate
This allows you to specify that the data in the invoking view must be saved before a forward navigation. When set toTrue, a save will be attempted before the navigation. If this save fails or there was nothing to save (an empty record), the navigation is canceled. Normally, this would be set inOnGetNavigateForwardDatawhen moving from a Zoom view to a child Select or Zoom view. -
NamedValues
This is an array of name/value pairs. This can be used by the developer to pass additional data back and forth between the invoking view and the invoked view. The values and meanings of these named data pairs must be defined by the developer. They have no meaning and are not used by the framework. These would be set inOnGetNavigateForwardDataandOnGetNavigateBackData. If set, you will need to write code to get these data values and act on them. This is often done in theOnNavigateForwardandOnNavigateBackevents. Methods exist in thecWebViewclass that allow you to add named value pairs to this array (NamedValueAdd) and to find a value based on its name (NamedValueGetandNamedValueIndex).
Navigation Topics
- Previous Topic: Understanding Navigation
- Next Topic: The Forward Navigation Process