Wish [B4xPages] ShowPageWithData

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
In most of my apps, I use a b4xpage to show data based on some other app action, like a details screen. I do this a lot, as it means that my b4xpages become reusable.

To do this I need to call ShowPage an then call a function on the B4xPage to set the data
B4X:
    B4XPages.ShowPage("LinkServiceProvider")
    ' All of the B4xPages are initialised in MainPage and made public
    B4XPages.MainPage.lspp.SetInfo(SelectedMonitoringPoint)
    
    or
    
    ' If the page is not previously declared
    B4XPages.ShowPage("LinkServiceProvider")
    Private linkpage As LinkServiceProvider = B4XPages.GetPage("LinkServiceProvider")
    linkpage.SetInfo(SelectedMonitoringPoint)

It would be great if I could just call

B4xPages.ShowPageWithData("LinkServiceProvider",SelectedMonitoringPoint)

This would then implicitly call a standard B4xpages function called something like
B4X:
Private sub B4xpage_setData(data as object)
' data is the information provided to ShowPageWithData
end sub

I think that this would be a much cleaner way of handling this.
 
Top