Bug? ListView

Pedro Caldeira

Active Member
Licensed User
Longtime User
When trying to get the value of a listview selectedindex i always get a null value.
if i include the selecteditem, i get both values. and with just selectedItem work well.

B4X:
Sub listRooms_SelectedIndexChanged(Index As Int)

      Dim xVarInx as string
      Dim iVarInx as string
  
      xVarInx=listRooms.SelectedItem
      iVarInx=listRooms.SelectedIndex
   
      GetRooms (iVarInx)  
      GetFullRooms (iVarInx, xVarInx)

End Sub

Sub GetRooms ( RoomNumber as string)
   
      msgbox.show (RoomNumber,"") ' Get nothing. Why ???

End Sub

Sub GetFullRooms ( RoomNumber as string, RoomName as string )
   
      msgbox.show (RoomNumber,RoomName) ' Get Number and Name.

End Sub
 

sonicmayne

Member
Licensed User
Longtime User
I believe it's an issue with the jMsgboxes library. I've seen it here, it happens if text is too small (and sometimes just a number). I solved it by appending a space to the end of the displayed text.

For example:
B4X:
Sub GetRooms ( RoomNumber as string)
  
      msgbox.show (RoomNumber & " ","")

End Sub

Hope this helps
 

Pedro Caldeira

Active Member
Licensed User
Longtime User
Hello all.
It works.
Indeed must be that small text issue. Just a minor glitch, easily solvable with that solution.
Thank you all.
 
Top