Need to get the Root and Class instance (Me) of a B4XPage in a normal class and make sure it is all done before I continue.
Tried this one:
in the B4XPage:
In the class:
calling it in the class like this from a normal Sub:
It runs all fine, but it doesn't wait, so I get the wrong B4XPage root (the old one) to work with.
Any suggestions how this should be done?
RBS
Tried this one:
in the B4XPage:
B4X:
Sub PassClassAndRoot
Log("PassClassAndRoot")
cMenu.Root = Root
cMenu.B4XPage = Me
CallSubDelayed(cMenu, "PassClassAndRoot_Done")
End Sub
In the class:
B4X:
Sub setRoot(oRoot As B4XView)
Log("setRoot, oRoot.Tag: " & oRoot.Tag)
moRoot = oRoot
End Sub
Sub setB4XPage(oB4XPage As Object)
mCallBack = oB4XPage
End Sub
calling it in the class like this from a normal Sub:
B4X:
CallSubDelayed(B4XPages.GetPage("Page" & miButtonStartIndex), "PassClassAndRoot")
Wait For PassClassAndRoot_Done Complete
It runs all fine, but it doesn't wait, so I get the wrong B4XPage root (the old one) to work with.
Any suggestions how this should be done?
RBS