Android Question [B4X] [XUI] B4XComboBox - implementation problem

Tomas Petrus

Active Member
Licensed User
Hi guys I am trying to implement B4XComboBox for language selection.

So far I ended with following error when selecting one of the options:
B4X:
An error occurred: 
(Line: 101) Return cmbBox.SelectedIndex
java.lang.Exception: Sub jazykb4xcombobox_selectedindexchanged signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject cz.esol.ecoTaxi.main_subs_0._jazykb4xcombobox_selectedindexchanged() throws java.lang.Exception

class java.lang.Integer,

current code
B4X:
'Nastaveni
Sub Nastaveni
    Activity.LoadLayout("Nastaveni")
    JazykLbl.Text = Slovnik.h29
    LoadJazykyCmb
   
    'vytvoreni mapy (key/value)
    Dim i As Int  = 0
    For Each Jazyk In Slovnik.JazykySeznam
        JazykyValues.Put(i, Jazyk) 
        JazykyNames.Add(Jazyk)
        i = i + 1
    Next

    'vyber jazyka
    JazykB4XComboBox.SetItems(JazykyNames)
End Sub

Sub LoadJazykyCmb
    JazykyNames.Initialize
    JazykyValues.Initialize
End Sub

Sub JazykB4XComboBox_SelectedIndexChanged
    Msgbox("jazyk",JazykB4XComboBox.SelectedIndex)
End Sub

What am I doing wrong ?
The error is not of much help.
I even tried to replace line 79 in BAS file

B4X:
'Return cmbBox.SelectedIndex
Return 3

But I have got same error

thanks for any advices : )
 

Star-Dust

Expert
Licensed User
From the error it seems that some parameters are missing B4XComboBox_SelectedIndexChanged (...)
 
Last edited:
Upvote 0
Top