Android Question Inserimento valori su form dinamicamente

iz3spv

Member
In italiano:

Ciao a tutti,

premetto che sono alle prime armi con basic4android...ora mi trovo davanti ad un dilemma: dopo aver estratto dei dati da un file .txt, ho la necessità di stamparli in lista, stile scrollView o listView, una volta stampati i dati in sequenza quando vado a cliccare in uno di questo dovrei caricare un nuovo layout con una nuova lista di elementi. Quello che devo fare io è gestire un'insieme di prodotti con: Categoria, Marca, Modello ecc. Quindi se io clicco in una della categorie disponibili dovrebbe caricarmi una nuova lista di tutte le marche co quella categoria e così via. Qualcuno sa come posso stampare i dati in modo sequenziale in modo da poter cliccare in uno di questi per poi caricare un secondo layout? il tutto deve essere svolto in modo dinamico, cioè le categorie ecc. non sono statiche ma possono variare. Grazie dell'aiuto

In english:

Hello to all,

state that I am a beginner with basic4android ... now I am faced
with a dilemma: after extracting data from a. txt file,
I need to print them in list, in the style of scrollView or listView,
when printed data in sequence when I go to click on one of these I should load a new layout
with a new list of items.
What I have to do is manage a set of products with: Category, Make, Model, etc..
So if I click on one of the categories available should a groovy new list of all brands
co that category and so on.
Does anyone know how I can print the data in a sequential manner in order to be able
to click on one of these and then load a second layout?
everything must be done dynamically, ie, categories etc.. are not static but may vary.
Thanks for your help
 

iz3spv

Member
i think you haven't understand what i would do... When i create a listView with some different values, after a click over someone of that values I need to open a new form, but to do this I need to read the listView single line value where i have clicked. Can you post a piece of code? Thank you
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
B4X:
    For i = 0 To 2
        Dim retmap As Map
        retmap.Initialize
        retmap.Put("tag","TagValue"&i)
        retmap.Put("itemID","ItemID"&i)
        retmap.Put("name","ItemName"&i)
        retmap.Put("line1","This is line 1")
        retmap.Put("line2","This is line 2")
        lv.AddTwoLines2(retmap.Get("line1"), retmap.Get("line2"), retmap)
    Next

Sub lv_ItemClick (Position As Int, Value As Object)
   Dim retmap As Map
   retmap = Value
   Log("Item at Pos "&Position&" Clicked...")
   Log("ItemInfos:")
   Log("tag = "&retmap.Get("tag"))
   Log("itemID = "&retmap.Get("itemID"))
   Log("name = "&retmap.Get("name"))
   Log("line 1 = "&retmap.Get("line1"))
   Log("line 2 = "&retmap.Get("line2"))
End Sub
 

Attachments

  • listviewtest.zip
    8 KB · Views: 172
Upvote 0
Top