Hi Everyone,
I'm using Nice Spinner with dependent Combo Boxes
As the combo boxes get populated I get the following error?
If I understand this correctly the index should equal two?
How would I set up the correct number of indexes?
I'm using Nice Spinner with dependent Combo Boxes
As the combo boxes get populated I get the following error?
If I understand this correctly the index should equal two?
How would I set up the correct number of indexes?
java.lang.IndexOutOfBoundsException: Invalid index 5, size is 2
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.get(ArrayList.java:308)
at main.java.org.angmarch.views.NiceSpinnerAdapter.getItemInDataset(NiceSpinnerAdapter.java:37)
at main.java.org.angmarch.views.NiceSpinner.setAdapterInternal(NiceSpinner.java:253)
at main.java.org.angmarch.views.NiceSpinner.attachDataSource(NiceSpinner.java:248)
at nicespinnerwrapper.niceSpinnerWrapper.attachDataSource(niceSpinnerWrapper.java:207)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
B4X:
sub sizecmb_spinner_touched
Log("sizecmb spinner touched")
Dim l As List : l.Initialize
Dim query1 As String
l.Add("SELECT SIZE")
For i=0 To l.Size -1
l.Add(l.Get(i))
Next
Log(l)
If weightcmbval="SELECT WEIGHT" And connectionnamecmbval="SELECT CONNECTION" Then
query1="SELECT distinct SIZE FROM DB order by SIZE asc"
Else If weightcmbval <> "SELECT WEIGHT" And connectionnamecmbval="SELECT CONNECTION" Then
query1="SELECT distinct SIZE FROM DB WHERE WEIGHT=" & """" & weightcmbval &"""" &" order by SIZE asc"
Else If weightcmbval <> "SELECT WEIGHT" And connectionnamecmbval <> "SELECT CONNECTION" Then
query1="SELECT distinct SIZE FROM DB WHERE CONNECTIONNAME=" & """" & connectionnamecmbval & """" & "AND WEIGHT=" & """" & weightcmbval &"""" &" order by SIZE asc"
Else If weightcmbval="SELECT WEIGHT" And connectionnamecmbval <> "SELECT CONNECTION" Then
query1="SELECT distinct SIZE FROM DB WHERE CONNECTIONNAME=" & """" & connectionnamecmbval & """" & " order by SIZE asc"
Else
query1="SELECT distinct SIZE FROM DB order by SIZE asc"
End If
Log(query1)
Dim rs As ResultSet = sql1.ExecQuery(query1)
Do While rs.NextRow
l.Add(NumberFormat2(rs.GetString("SIZE"),0,3,3,False))
Loop
Log(l)
sizecmb.attachDataSource(l)
rs.Close
End Sub