Android Question customlistview Value

MroBurk

Member
Licensed User
Hi I created the db with a customlistview, I need Help because the Customlistview_clickItem doesn't work... It seems that it cannot take the value of the list. Can you Help me? When the Item is clicked, it opens the next activity with the last row, not by the clicked... thanks!!
 

Attachments

  • DB.zip
    14 KB · Views: 88

mangojack

Expert
Licensed User
Longtime User
To begin with ... You have not passed a Value when adding to the CLV...

B4X:
CustomListView1.Add(p, "")
B4X:
Private Sub CustomListView1_ItemClick (Index As Int, Value As Object)
Status = "U"
rs= Starter.sql.ExecQuery("SELECT * FROM Table1 WHERE Name ='" & Value & "'")

Make the following changes ...
B4X:
CustomListView1.Add(p, NOME)
B4X:
Private Sub CustomListView1_ItemClick (Index As Int, Value As Object)
Status = "U"
rs= Starter.sql.ExecQuery2("SELECT * FROM Table1 WHERE Name = ? ", Array As String(Value))
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
To begin with ... You have not passed a Value when adding to the CLV...

B4X:
CustomListView1.Add(p, "")
B4X:
Private Sub CustomListView1_ItemClick (Index As Int, Value As Object)
Status = "U"
rs= Starter.sql.ExecQuery("SELECT * FROM Table1 WHERE Name ='" & Value & "'")

Make the following changes ...
B4X:
CustomListView1.Add(p, NOME)
B4X:
Private Sub CustomListView1_ItemClick (Index As Int, Value As Object)
Status = "U"
rs= Starter.sql.ExecQuery2("SELECT * FROM Table1 WHERE Name = ? ", Array As String(Value))
That is: do what @LucaMs did in the project he attached ;)
 
Upvote 0
Top