Android Question Go to special page without page object

darabon

Active Member
I have many pages in my project.
I want go to a special page with an id without understanding the page object
For example, login page (pagelogin ID) or profile page (pageProfile ID)
For adding a page, We have to use B4XPages.AddPage("profile",pgProfile_)
pgProfile_ is Private pgProfile_ As pgAccount
But because my pages are very many, I cannot declare for each page
How can I go to the page now?
 

Lucas Siqueira

Active Member
Licensed User
Longtime User
I have many pages in my project.
I want go to a special page with an id without understanding the page object
For example, login page (pagelogin ID) or profile page (pageProfile ID)
For adding a page, We have to use B4XPages.AddPage("profile",pgProfile_)
pgProfile_ is Private pgProfile_ As pgAccount
But because my pages are very many, I cannot declare for each page
How can I go to the page now?

Declare all your pages as Public in Sub Class_Globals in the B4XMainPage module.
1712589242090.png


This way you will be able to access functions that exist within the page.

when I want to open a page and pass a value to the page.
B4X:
    B4XPages.ShowPage("PageData")
    B4XPages.MainPage.PageData.loadData("2")
1712589391492.png


this way, you open the page
and pass the parameter you want.


 
Upvote 0

darabon

Active Member
Declare all your pages as Public in Sub Class_Globals in the B4XMainPage module.
View attachment 152542

This way you will be able to access functions that exist within the page.

when I want to open a page and pass a value to the page.
B4X:
    B4XPages.ShowPage("PageData")
    B4XPages.MainPage.PageData.loadData("2")
View attachment 152543

this way, you open the page
and pass the parameter you want.


If I declare pages on first time, maybe the app be slowly
 
Upvote 0

darabon

Active Member
Calling B4XPage.AddPage many times will not have any effect on the performance. The pages are only really created when the page is first shows or if you call B4XPage.AddPageAndCreate.
That is good if does not affect on performance
Thanks
 
Upvote 0
Top