B4J=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=8.5
@EndOfDesignText@
Sub Class_Globals
	Private Root As B4XView 'ignore
	Private xui As XUI 'ignore
	
	Private lblMain As B4XView
	Private xcbxPage1 As B4XComboBox
	
	Public SelectedIndex As Int
	Public SelectedItem As String
End Sub

'You can add more parameters here.
Public Sub Initialize As Object
	Log("Page Init")
	
	Return Me
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
	Log("Page Create")
	Root = Root1
	Root.LoadLayout("Page1")
	
	FillComboBox
End Sub

Private Sub B4XPage_Appear
	lblMain.Text = B4XPages.MainPage.SelectedItem
End Sub

Private Sub B4XPage_Disappear
	B4XPages.MainPage.Update
End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

'Initialize the B4XComboBox with Page1 & i 
'Select the first item
Private Sub FillComboBox
	Private i As Int
	Private lst As List
	
	lst.Initialize
	For i = 0 To 10
		lst.Add("Page1 " & i)
	Next
	xcbxPage1.SetItems(lst)
	
	xcbxPage1.SelectedIndex = 0	'We memorize the Index in the variable
	SelectedItem = xcbxPage1.SelectedItem	'We memorize the Item in the variable
End Sub

Private Sub xcbxPage1_SelectedIndexChanged (Index As Int)
	SelectedIndex = Index	'We memorize the Index in the variable
	SelectedItem = xcbxPage1.SelectedItem	'We memorize the Item in the variable
End Sub

