How do you set the value for different values. Say you select the third value how can you change the text value for it.?
You need to Refill your items to te spinner. Remove all items and fill them again (with new values).how can you change the text value for it.
Sub Globals
Dim aSpinner As Spinner
Dim aList As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
aList.Initialize
aList.AddAll(Array As String("item 1","item 2","item 3"))
aSpinner.Initialize("aSpinner")
aSpinner.AddAll(aList)
Activity.AddView(aSpinner,0,0,50%x,15%y)
End Sub
Sub aSpinner_ItemClick (Position As Int, Value As Object)
Dim anInputDialog As InputDialog
anInputDialog.Input=Value
anInputDialog.Show("New Value:","Edit Pos" & Position & " - " & Value,"OK","Cancel","",Null)
If anInputDialog.Response=DialogResponse.POSITIVE Then
Dim newValue As String=anInputDialog.Input
aList.InsertAt(Position,newValue)
aList.RemoveAt(Position+1)
aSpinner.Clear
aSpinner.AddAll(aList)
End If
End Sub
'aList.Initialize ' aList initialize and populate before using (app start ??)
aList.RemoveAt(Position) ' <<<<<< Error !
Msgbox(Position,newValue)
aList.InsertAt(Position,newValue)
spnNameTeams.Clear
Msgbox(aList,"alist")
spnNameTeams.AddAll(aList)
I get an invalid index 0, size 0 error. On this line. aList.RemoveAt(Position)
also to avoid possible error, follow order of above example from @mc73 .. add new value to list before removing old value
I get an invalid index 0, size 0 error. On this line. aList.RemoveAt(Position)
Dim anInputDialog As InputDialog
anInputDialog.Input=Value
anInputDialog.Show("New Value:","Edit Pos" & Position & " - " & Value,"OK","Cancel","",Null)
If anInputDialog.Response=DialogResponse.POSITIVE Then
Dim newValue As String=anInputDialog.Input
aList.Initialize
Msgbox(aList.Size,"")'0
aList.RemoveAt(Position) ' <<<<<< Error !
Msgbox(Position,newValue)
aList.InsertAt(Position,newValue)
spnNameTeams.Clear
Msgbox(aList,"alist")
spnNameTeams.AddAll(aList)
End If
So with a slider you can't say the value at this position equals this text?
Have you read any of the previous post comments ?#6 Is a spinner using a LIST. Can't you just say spn.position value = "Some Text"? I posted the code I am using and the error #14.