B4A Library Popup Menu/List Library

cnicolapc

Active Member
Licensed User
Longtime User
Thank you very much,
I never thought, I modified the code and now it works.
Bye
Nicola
B4X:
Sub BtnGenere_CLick
Dim r As List 
r.Initialize 
Dim x As id 
Dim m As Int
Dim responseString As String


    
    Dim ValoreGenere As String
    Dim r As List
    r.Initialize 
    
    ListaGenere.Initialize("ListaGenere")
    Cursor1 = Main.Sql1.ExecQuery("SELECT Genere FROM GenereTab Order By Genere ASC")
    For i = 0 To Cursor1.RowCount - 1
        Cursor1.Position = i
        ValoreGenere=Cursor1.GetString("Genere")
        If ValoreGenere.Length >=30 Then
        ValoreGenere=ValoreGenere.SubString2(0,30)&"..."
        End If
        ValoreGenere=ValoreGenere.Replace(Chr(13), " ")
        ValoreGenere=ValoreGenere.Replace(Chr(10), " ")
        
      
        r.Add(ValoreGenere)
            
       Next

    m = x.InputList1(r,"Hello")
Msgbox(m,"Result Integer")
responseString = r.Get(m)
Msgbox(responseString,"Result String")
    

        End Sub
 

roarnold

Active Member
Licensed User
Longtime User
I am giving this a whirl as it may solve a problem I have been fighting over. Why is Cursor1 and Gene still red?

B4X:
Dim r As List 
               r.Initialize 
               Dim x As id 
               Dim m As Int
               Dim responseString As String


                   Dim  ListaGenere As List
                   Dim ValoreGenere As String
                  Curcor1 As SQL 
                   Dim r As List
                   r.Initialize 
                   
                   ListaGenere.Initialize("ListaGenere")
                   Cursor1 = Main.Sql1.ExecQuery("SELECT Genere FROM GenereTab Order By Genere ASC")
                   For i = 0 To Cursor1.RowCount - 1
                       Cursor1.Position = i
                       ValoreGenere=Cursor1.GetString("Genere")
                       If ValoreGenere.Length >=30 Then
                       ValoreGenere=ValoreGenere.SubString2(0,30)&"..."
                       End If
                       ValoreGenere=ValoreGenere.Replace(Chr(13), " ")
                       ValoreGenere=ValoreGenere.Replace(Chr(10), " ")
                       
                       Gene = Array As String(ValoreGenere)
                       r.Add(Gene)
                           
                      Next

               m = x.InputList1(r,"Hello")
               Msgbox(m,"Result Integer")
               responseString = r.Get(m)
               Msgbox(responseString,"Result String")

Thanks,
R
 

klaus

Expert
Licensed User
Longtime User
What is the line below supposed to be ?
B4X:
Curcor1 As SQL
Shouldn't it be
B4X:
Dim Cursor1 As Cursor
What is this line supposed to do ?
B4X:
Gene = Array As String(ValoreGenere)
Where is Gene declared ?
You use Gebe as an array but ValoreGenere is a String ?

Best regards.
 

shashkiranr

Active Member
Licensed User
Longtime User
Hi Thedesolatesoul,

Thank you so much just what i needed. i wanted the popup to be in the middle and since i had only one item in the list. Works Beautifully

Regards,
SK
 

socialnetis

Active Member
Licensed User
Longtime User
Excellent! This is what I was looking for.
How strange that this is not part of the core library yet. Or at least I didn't find it
 

Javier Alonso

Member
Licensed User
Longtime User
Hi,

I would like to have the "id" library adapted to the InputListAsync method, if possible, to make menus with a simple inputlist. I have been using the feature widely and I would like to migrate to async. Thanks in advance!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…