D dannyjon Member Licensed User Longtime User Feb 7, 2021 #1 In my code, PageCreated calls a Sub. If I navigate away from the page and go back, PageCreated does not fire and the sub does not get called. I know pages can not be destroyed with B4X which gives a smooth UI but how can I call a method? Initialize will not allow it to be called there. I tried to initialize the page in the method that calls this page to load but it made no difference. I think I must have missed a very simple thing here. Thank you! B4X: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 Root.LoadLayout("drawinglist") CLV1.Clear MsgboxAsync("page created object fired","") GetLocalDWG '<<<<<<<This needs to fire each time the page is accessed'
In my code, PageCreated calls a Sub. If I navigate away from the page and go back, PageCreated does not fire and the sub does not get called. I know pages can not be destroyed with B4X which gives a smooth UI but how can I call a method? Initialize will not allow it to be called there. I tried to initialize the page in the method that calls this page to load but it made no difference. I think I must have missed a very simple thing here. Thank you! B4X: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 Root.LoadLayout("drawinglist") CLV1.Clear MsgboxAsync("page created object fired","") GetLocalDWG '<<<<<<<This needs to fire each time the page is accessed'
DonManfred Expert Licensed User Longtime User Feb 7, 2021 #2 Create a sub to call GetLocalDWG in there or move the loading to the correct event. See the available Events for B4XPages. Page created is called once. Upvote 0
Create a sub to call GetLocalDWG in there or move the loading to the correct event. See the available Events for B4XPages. Page created is called once.
M Mahares Expert Licensed User Longtime User Feb 7, 2021 #3 dannyjon said: I must have missed a very simple thing here Click to expand... Maybe something like this: Code: Copy Sub B4XPage_Appear GetLocalDWG '<<<<<<<This needs to fire each time the page is accessed' End Sub You take GetLocalDWG off the B4XPage_Created. Now, my knowledge of B4XPages is still shaky, but I have seen similar questions before, so I thought I take a stab at it. Upvote 0
dannyjon said: I must have missed a very simple thing here Click to expand... Maybe something like this: Code: Copy Sub B4XPage_Appear GetLocalDWG '<<<<<<<This needs to fire each time the page is accessed' End Sub You take GetLocalDWG off the B4XPage_Created. Now, my knowledge of B4XPages is still shaky, but I have seen similar questions before, so I thought I take a stab at it.