B4J Question How to add checkbox ?

Status
Not open for further replies.

ykucuk

Well-Known Member
Licensed User
Longtime User
Hello,

How can I add/read checkbox column in the B4XTable?

i tried below code but it doesn't work.
B4X:
CheckColumn = B4XTable1.AddColumn("Check", B4XTable1.COLUMN_TYPE_TEXT)
B4XTable1.AddColumn("CategoryID", B4XTable1.COLUMN_TYPE_TEXT)
B4XTable1.AddColumn("Category", B4XTable1.COLUMN_TYPE_TEXT)
CheckColumn.Width = 160dip
CheckColumn.Searchable = False
CheckColumn.Sortable = False

Dim Data As List
Data.Initialize
Dim i As Int =0
Dim j2 As  HttpJob
j2.Initialize("", Me)
j2.PostString("http://www.sacredsensualgetaways.com/sys2906yu.php?jType=usp_CategoriesSelectWithQuery","whereSql= CategoryID >0" )
Wait For (j2) JobDone(j2 As HttpJob)
If j2.Success Then

Dim parser As JSONParser
parser.Initialize(j2.GetString)
Dim root As Map = parser.NextObject
Dim Message As String = root.Get("Message")
Dim Results As List = root.Get("Results")
For Each colResults As Map In Results
Dim row(3) As Object
row(0)="abc" ' it supposed to be checkbox
row(1) = colResults.Get("CategoryID")
row(2) = colResults.Get("Name")
Data.Add(row)
i=i+1
Next

B4XTable1.SetData(Data)
End If
j2.Release



For i = 1 To CheckColumn.CellsLayouts.Size - 1
Dim pnl As B4XView = CheckColumn.CellsLayouts.Get(i)
Dim ch As CheckBox
ch.Initialize("")
pnl.AddView(ch, 5dip, 5dip,  32dip, 32dip)
Next
 

Peter Lewis

Active Member
Licensed User
Longtime User


Example is attached.
hi
Is there a reason why this example does not compile ?
I get this error

Thank you
 
Upvote 0
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…