B4J Question TabPane - how to open B4xPage inside of TabPane

DarkoT

Active Member
Licensed User
Hi to all with all best wishes for 2023...

I need suggestion how to open different pages inside of tabpane; each modul should create new "tab" wich has same controls (buttons, label names, ...).

Any suggestion - how to open b4xpage inside of TabPane?

1672659441763.png
 
Solution
B4X:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private TabPane1 As TabPane
    Private tb1 As Tab1
End Sub

Public Sub Initialize
End Sub

Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    tb1.Initialize(TabPane1) 'example of a class for a specific tab
    For i = 2 To 10
        Dim gt As GenericTab 'more generic class
        gt.Initialize(TabPane1, "Tab " & i)
    Next
End Sub

1672725457108.png

DarkoT

Active Member
Licensed User
I wouldn't use B4XPages for such case. It will only make things more complicated.

You can implement each tab (panel) in its own class if you like.
okey, clear... It's there some example how to add different layouts to tabpane from class (inside of B4xMainPage) - without "external" opening (as page).

And - if is posible - i'm sure that functionality with load b4xpages into tabs (tabpane) will be very useful.... I found a Wish from Magma...


Can you make it posible? ;)
Thaaaanks....
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private TabPane1 As TabPane
    Private tb1 As Tab1
End Sub

Public Sub Initialize
End Sub

Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    tb1.Initialize(TabPane1) 'example of a class for a specific tab
    For i = 2 To 10
        Dim gt As GenericTab 'more generic class
        gt.Initialize(TabPane1, "Tab " & i)
    Next
End Sub

1672725457108.png
 

Attachments

  • Project.zip
    11.5 KB · Views: 90
Upvote 0
Solution
Top