GetNavigateData - cWebView

Gets the tWebNavigateData for the view

Type: Function

Return Data Type: tWebNavigateData

Parameters: None

Return Value


Syntax
Function GetNavigateData Returns tWebNavigateData

Call: Get GetNavigateData to tWebNavigateDataVariable


Description

GetNavigateData returns the current tWebNavigate data for view by accessing a private web property. Often, this data will be passed into the event or method you are augmenting. If it is not, the data must be accessed using GetNavigateData.

Any time the tWebNavigateData data is passed into a method or event you are augmenting, you should use that passed data and not by calling GetNavigateData. Those methods are OnGetNavigateBackData, OnGetNavigateForwardData, OnNavigateBack, OnNavigateForward and OnNavigateForwardPreFindInit.

You can use SetNavigateData to store this changed data.

GetNavigateData will often be used in select views to determine how the OnRowClick of a cWebList should respond. A developer must get the NavigateData, analyze the data and make decisions based on this.

Procedure OnRowClick String sRowID
    tWebNavigateData NavigateData
    String sTask
    Boolean bFound
    Get GetNavigateData to NavigateData
    Case Begin
        Case (NavigateData.eNavigateType=nfFromChild)
        Case (NavigateData.eNavigateType=nfFromMain)
            // a child or main lookup 
            Send NavigateClose Self
            Case Break
        Case (NavigateData.eNavigateType=nfFromParent)
            // not used yet
            Case Break
        Case Else
            Get NamedValueGet NavigateData.NamedValues "task" to sTask
            If (sTask="maint") Begin
                Send NavigateForward to oZoomCustomer Self
            End
            Else Begin
                Register_Object oSelectOrder
                Send NavigateForward to oSelectOrder Self
            End
    Case End
End_Procedure

In views, GetNavigateData might be used to determine how action menu items should behave. Zoom views will often have code similar to this:

Procedure SetActionButtons
    String sCaption
    Integer iMode
    tWebNavigateData NavigateData
    Get GetNavigateData to NavigateData
    Move NavigateData.eNavigateType to iMode

    WebSet pbRender of oEditBtn to False 
    WebSet pbRender of oSaveBtn to False

    If (iMode= nfFromMain or iMode=nfFromChild) Begin
        If (NavigateData.bReadOnly) Begin 
            WebSet pbRender of oEditBtn to True 
        End
        Else Begin
            WebSet pbRender of oSaveBtn to True
        End
    End
End_Procedure

While you may use the data in the tWebNavigateData.eNavigateType struct member array directly, you are encouraged to use the NamedValueAdd and NamedValueGet interfaces.