I have multiple pages created in my main module as follows:-
In My Main Module
Page2.Initialize
Page3.Initialize
Page4.Initialize
Page5.Initialize
Page6.Initialize
Page7.Initialize
Page8.Initialize
Page9.Initialize
B4XPages.AddPage("B4XSetups", Page2)
B4XPages.AddPage("B4XTableDays", Page3)
B4XPages.AddPage("Reporting", Page4)
B4XPages.AddPage("BookingScreen", Page5)
B4XPages.AddPage("GateReport", Page6)
B4XPages.AddPage("GateKeeper", Page7)
B4XPages.AddPage("InMateCall", Page8)
B4XPages.AddPage("CalendarView", Page9)
Initial Tables Exist and initialized
Initial Tables Exist and initialized
Initial Tables Exist and initialized
*** mainpage: B4XPage_Appear
*** mainpage: B4XPage_Resize [mainpage]
*** calendarview: B4XPage_Created [mainpage]
Tables Exist and initialized
Mainform loaded
Below is the runtime error which happens on the splitMain.LoadLayout("LeftSide")
If I comment that out the error comes on the next line.....
Error occurred on line: 234 (CalendarView)
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:482)
at b4j.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:871)
at b4j.example.b4xpagesmanager._showpage(b4xpagesmanager.java:350)
What I did was create a separate app to test the code and it was fine... i Then copied it into my main app and had to have the
B4XPage_Created (Root1 As B4XView) sub otherwise the page declarations in the main module show an error.
I am quite sure it is something quite simple but I just cant see it.
if anyone can shed some light on my error it would be appreciated
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
Public DBFileDir As String = File.DirApp&"\legals"
If File.Exists(DBFileDir, "LegalVisits.db") = False Then
DB.InitializeSQLite(DBFileDir, DBFileName, True)
Else
DB.InitializeSQLite(DBFileDir, DBFileName, True)
If LastException.IsInitialized Then Log(LastException.Message)
Log("Tables Exist and initialized")
End If
Private fx As JFX
Root.IsInitialized
MainForm = B4XPages.GetNativeParent(Me)
MainForm.SetFormStyle("UNIFIED")
MainForm.RootPane.LoadLayout("CalendarView")
Log("CalendarView loaded")
[B] splitMain.LoadLayout("LeftSide")
splitMain.LoadLayout("RightSide")[/B]
' Form1.Title = "Months Calendar View"
CreateRightSizeLayout
MainForm.Show
' Generate_dates
' LoadData
End Sub
In My Main Module
B4X:
Private Page2 As B4XSetups
Private Page3 As B4XTableDays
Private Page4 As Reporting
Private Page5 As BookingScreen
Private Page6 As GateReport
Private Page7 As GateKeeper
Private Page8 As InMateCall
Private Page9 As CalendarView
Page2.Initialize
Page3.Initialize
Page4.Initialize
Page5.Initialize
Page6.Initialize
Page7.Initialize
Page8.Initialize
Page9.Initialize
B4XPages.AddPage("B4XSetups", Page2)
B4XPages.AddPage("B4XTableDays", Page3)
B4XPages.AddPage("Reporting", Page4)
B4XPages.AddPage("BookingScreen", Page5)
B4XPages.AddPage("GateReport", Page6)
B4XPages.AddPage("GateKeeper", Page7)
B4XPages.AddPage("InMateCall", Page8)
B4XPages.AddPage("CalendarView", Page9)
B4X:
Initial Tables Exist and initialized
Initial Tables Exist and initialized
Initial Tables Exist and initialized
*** mainpage: B4XPage_Appear
*** mainpage: B4XPage_Resize [mainpage]
*** calendarview: B4XPage_Created [mainpage]
Tables Exist and initialized
Mainform loaded
Below is the runtime error which happens on the splitMain.LoadLayout("LeftSide")
If I comment that out the error comes on the next line.....
Error occurred on line: 234 (CalendarView)
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:482)
at b4j.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:871)
at b4j.example.b4xpagesmanager._showpage(b4xpagesmanager.java:350)
What I did was create a separate app to test the code and it was fine... i Then copied it into my main app and had to have the
B4XPage_Created (Root1 As B4XView) sub otherwise the page declarations in the main module show an error.
I am quite sure it is something quite simple but I just cant see it.
if anyone can shed some light on my error it would be appreciated