iOS Question Loading Page

David Hawkins

Active Member
Licensed User
Longtime User
Hi I have an App with 18 pages all of which are loaded using the following code (this is only showing page 6)

The code below is in B4XMainPage

Page load:
Sub Class_Globals
     Public Page6 As CompanyList
End Sub


Public Sub Initialize
'    B4XPages.GetManager.LogEvents = True

    Page6.Initialize

End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("Login")

    B4XPages.AddPage("CompanyList", Page6)
   
End Sub

The code for loading a page is

Load Page 6:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    'load the layout to Root

    Root.LoadLayout("ListOfCompanies")

    s_Menu = Array As String("New Company/Location", "New User",  "Remove User", "Group Emails", "Password")

End Sub

and it fails with the following error

Target is null. Method called: _initialize:::

I have stepped through the code and the page is being initialized

What is going on?

OK now sorted the flexgrid on the page was causing a problem I replaced it and now all is working
 
Last edited:

David Hawkins

Active Member
Licensed User
Longtime User
Try moving this line to the B4XPage_Created sub instead.
Hi walter25 thank you for your response it is much appreciated, however the problem was a Flexgrid on the page I was trying to open, I replaced the Flexgrid and all is working OK now.

Many regards
David
 
Upvote 0
Top