Click item and checkbox in a customlisview and update database
I used the code of this post:
http://www.b4x.com/android/forum/threads/customlistview-and-database.30541/#post-177587
to execute an SQL that returns several fields and populate a customlistview with a few fields of this SQL and is OK.
I have two questions:
1 - I put a checkbox in the customlistview, related with a boolean field in database.
How I can click in this checkbox and update the boolean field in database?
2 - How I can click in a item of customlistview and show all fields of selected item in a messagebox?
I try to make this, but not works (Logs shows: "No records found. (Map) Not initialized"):
Where I going wrong?
Thanks in advance.
I used the code of this post:
http://www.b4x.com/android/forum/threads/customlistview-and-database.30541/#post-177587
to execute an SQL that returns several fields and populate a customlistview with a few fields of this SQL and is OK.
I have two questions:
1 - I put a checkbox in the customlistview, related with a boolean field in database.
How I can click in this checkbox and update the boolean field in database?
2 - How I can click in a item of customlistview and show all fields of selected item in a messagebox?
I try to make this, but not works (Logs shows: "No records found. (Map) Not initialized"):
B4X:
Sub clv1_ItemClick (index As Int, Value As Object)
Dim m As Map
m = DBUtils.ExecuteMap(Main.SQL1, "SELECT id, project, author, marked FROM myTable WHERE id = ?", Array As String(Value))
Dim myText As String
myText = m.Get("project") & CRLF & m.Get("author")
Msgbox(myText, "")
End Sub
Where I going wrong?
Thanks in advance.