Android Question [B4X] xCustomListView GetPanelByItemID

Discussion in 'Android Questions' started by Alexander Stolte, Jun 6, 2018.

  1. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    Hello,

    how i can set a ItemID (String or object) and from this i can get the right Panel. For Access a view. I fill my list with 2 databases and i cant Access the right Panel over the id from the database.

    Greetings
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    What are you storing as the items values?
     
  3. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    for example, i create my list and i can set a itemid or a Value and from this Value i can get the panel id for listview.getpanel(GetPanelByItemID ("c_456"))

    the item id is for example content id and for seperating it i would set a "c_" and then i can find the right panel with "c_456", because in the Second database is a item with the same Content id for example
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Add to your code:
    Code:
    Sub GetPanelBasedOnId (list As CustomListView, value As StringAs B4XView
       
    For i = 0 To list.Size - 1
           
    If list.GetValue(i) = value Then Return list.GetPanel(i)
       
    Next
       
    Return Null
    End Sub
     
    mangojack and Alexander Stolte like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice