iOS Question Call Back button programmatically

ThePuiu

Active Member
Licensed User
Longtime User
From a page of the application by pressing a button open another page with a form. When saving the form I want to go back to the page from which I opened the form. How can I do this programmatically? (Similar to pressing the Back button on the top left of the page)
 

hatzisn

Expert
Licensed User
Longtime User
From the second page and above use the Show sub of the code module as described in the three page example. For returning to the first I have no clue.
 
Upvote 0

Steve Kwok

Member
Licensed User
Dear Erel,
My app currently contains 2 pages, one is Main and the other is SalesFigure.
The page SalesFigure is triggered from page Main's button.
The SalesFigure is working fine with SideMenuController but smc makes the "< back" button invisible.
Thus, I added a BarButton functioning as "< Back" Button to remedy this issue.

it works:
Sub Page1_BarButtonClick (Tag As String)
    Dim no As NativeObject = smc
    If no.GetField("openSide").AsNumber <> 0 Then
        smc.CloseMenu
        Return
    End If
    Select Tag
        Case "left"
            smc.OpenLeftMenu
        Case "back"                       
            Main.NavControl.RemoveCurrentPage
            'Only work (i.e. go back to main page) after SetPagesStack
            Main.NavControl.SetPagesStack(Array(Main.pgMain))            
    End Select
End Sub

I found that NavControl would back to Main page by:
1. RemoveCurrentPage and
2. setPagesStack
Otherwise, NavControl stay at original page (i.e. SalesFigure)!
 
Upvote 0
Top