B4J Question [SOLVED] B4XPages / B4XComboBox / Multiple Pages / How to update value in Main Page when closing another page?

christianjeannot

Member
Licensed User
Hello Community,

I am writing a Cross-Platform-App with B4XPages where I use a B4X ComboBox in the MainPage and in SecondPage.

When the SecondPage is closed I want to show the current selected Item from B4XComboBox[SecondPage] in the B4XComboBox[MainPage].

I tried
- the B4XPage_Appear event in the MainPage
- the B4XPage_Disappear event in the SecondPage

but I was not able to show the proper selected value in the B4XComboBox in the MainPage after the SecondPage was closed.

I searched in the forum and read several threads but found no one with an answer.

Has someone please a tip or a link where it is already discussed.

Also I was not able in MainPage to access a variable from SecondPage.

B4X:
B4XPages.SecondPage.VariableA
Get a unknown member.

When I try in SecondPage to access a value in MainPage this is working.

Best regards

--Christian
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The main page is the only page that you can directly get from B4XPages like this.

You have several ways to access other pages:
B4X:
Dim sp As SecondPage = B4XPages.GetPage("second page id")
Dim sp As SecondPage = B4XPages.MainPage.SecondPage 'SecondPage should be a global variable in B4XMainPage.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Upvote 0
Top