Android Question B4XComboBox1_SelectedIndexChanged in PreferencesDialog

AlfaizDev

Well-Known Member
Licensed User
I want to use an event B4XComboBox1_SelectedIndexChanged
I tried but I don't know how to get a result
 
Solution
I don't what you want to do. if you call the event in PreferencesDialog, I think you need to modify the PreferencesDialog class for your requirements

Yes I did something like that

in PreferencesDialog:
Public Sub B4XComboBox1_SelectedIndexChanged (Index As Int)

    B4XComboBox1IndexItem=Index
    B4XComboBox1IndexPanel = CustomListView1.GetItemFromView(Sender.As(B4XComboBox).mBase)
    CallSub(B4XPages.GetPage(PageId),"B4XComboBox1SelectedIndexChanged")

End Sub

in Module Page3:
PrefDialog.PageId="Page3"

Sub B4XComboBox1SelectedIndexChanged
    'Log(PrefDialog.B4XComboBox1IndexPanel)

    Dim IndexPanel As Int = PrefDialog.B4XComboBox1IndexPanel
    Dim IndexItem As Int = PrefDialog.B4XComboBox1IndexItem
    'Dim cmb As B4XComboBox  =...

teddybear

Well-Known Member
Licensed User
The index is the result you get
B4X:
Private Sub B4XComboBox1_SelectedIndexChanged (Index As Int)
    log("You selected "&Index)
End Sub
 
Upvote 0

teddybear

Well-Known Member
Licensed User
I don't what you want to do. if you call the event in PreferencesDialog, I think you need to modify the PreferencesDialog class for your requirements

 
Upvote 0

AlfaizDev

Well-Known Member
Licensed User
I don't what you want to do. if you call the event in PreferencesDialog, I think you need to modify the PreferencesDialog class for your requirements

Yes I did something like that

in PreferencesDialog:
Public Sub B4XComboBox1_SelectedIndexChanged (Index As Int)

    B4XComboBox1IndexItem=Index
    B4XComboBox1IndexPanel = CustomListView1.GetItemFromView(Sender.As(B4XComboBox).mBase)
    CallSub(B4XPages.GetPage(PageId),"B4XComboBox1SelectedIndexChanged")

End Sub

in Module Page3:
PrefDialog.PageId="Page3"

Sub B4XComboBox1SelectedIndexChanged
    'Log(PrefDialog.B4XComboBox1IndexPanel)

    Dim IndexPanel As Int = PrefDialog.B4XComboBox1IndexPanel
    Dim IndexItem As Int = PrefDialog.B4XComboBox1IndexItem
    'Dim cmb As B4XComboBox  = PrefDialog.CustomListView1.GetPanel(IndexPanel).As(B4XView).GetView(1).Tag

    If IndexPanel=7 Or IndexPanel=9 Or IndexPanel=13 Or IndexPanel=15 Then
        Dim cmb2 As B4XComboBox  = PrefDialog.CustomListView1.GetPanel(IndexPanel+1).As(B4XView).GetView(1).Tag
        cmb2.cmbBox.Clear
        Dim AyahCount As Int = AyatCountList.Get(IndexItem)
        
        For i=1 To AyahCount
            cmb2.cmbBox.Add(i)
        Next
        
    End If
'    cmb.cmbBox.Add
End Sub
 
Upvote 0
Solution
Top