In a B4XPages project added a code module holding constants.
In the code module, declared the B4XPages ID like:
When setting the constant as parameter in load layout (in B4XMainPage), the views of the layout are not found (log message).
Not sure if this is a bug or if constants needs to be declred different.
In the code module, declared the B4XPages ID like:
B4X:
Public Const MAINPAGE_ID As String = "MainPage"
...
When setting the constant as parameter in load layout (in B4XMainPage), the views of the layout are not found (log message).
B4X:
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Button1 As B4XView
Private Label1 As B4XView
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
' Using the constant string, the log shows:
' B4XMainPage - 11: Variable 'Button1' is never assigned any value. (warning #10)
' B4XMainPage - 12: Variable 'Label1' is never assigned any value. (warning #10)
Root.LoadLayout(Constants.MAINPAGE_ID)
' Tried this (declared a sub returning the constant) but same error
' Root.LoadLayout(Constants.Get_MainPage_ID)
' Using the string direct, no issue
'Root.LoadLayout("MainPage")
End Sub
Not sure if this is a bug or if constants needs to be declred different.