View with searchbox, SQL and 'favorites'?

nemethv

Member
Licensed User
Longtime User
Hi,

I'm basically hoping to build an scv or anything else that does the job, with two or three columns. Data would come from a local SQLite file. Col1 would be a radiobutton, Col2 would be hte name of the item and Col3 would be a tickbox or something similar. C1 isn't really necessary if it makes life complicated.

The SQL table has two columns, "name" and "fav" - the latter is a true/false text. Names are DISTINCT so at least that's easy.

In details:
- C1 is an indicator of selection, as in if the user clicks the name (C2) or the RadioBtn. (C1) then the selection is made and the list disappears (so preferably there wouldn't need to be a need for an OK button.)
- C2 is the name, it's read out from SQL.
- C3 is either a checkbox or can be an image that can be varied, as if the user clicks on the row in C3 then it gets added to a 'favorites' part of the database. In practice this would be an ALTER TABLE command where Fav would be switched from true to false and vica-versa.

In addition, and I managed to do this with listview, but I think that won't help me here, I'd need a searchbox because the list is rather long. When the user types in stuff into the searchbox, the list would re-list itself with only items that contain the keyword.

Kindof like this.
B4X:
For n=0 To List1.Size-1
      Word = List1.Get(n)
      WordLC = Word.ToLowerCase
      If (WordLC.Contains(New)) Then DrinksList.AddSingleLine(Word)
   Next

Is this possible by any chance? Bit complicated, but I'm sure people could make good use of it! :)
Thanks!!
 
Top