Hi All,
I need help using customlistview with b4xDialog.
Basically I am using jRDC2 to get some data, and it works fine with also the code for the xcustomlistview (I am reusing the same code in another panel).
But when I try to add the xclustomlistview items to b4xDialog, nothing shows up, the dialog appear but empty the code that I am using is as below.
Thanks for your help in advance!
End If
Return
I need help using customlistview with b4xDialog.
Basically I am using jRDC2 to get some data, and it works fine with also the code for the xcustomlistview (I am reusing the same code in another panel).
But when I try to add the xclustomlistview items to b4xDialog, nothing shows up, the dialog appear but empty the code that I am using is as below.
Thanks for your help in advance!
This is when I create b4xDialog and call the jrdc2 after that:
Dim p As B4XView = xui.CreatePanel("")
p.LoadLayout("layout1") --> xclv is on this panel - named CLVS1
p.SetLayoutAnimated(0, 0, 0, 100%x, 500dip)
Dim diags As B4XDialog
diags.Initialize(p_mof)
diags.Title = "x"
Dim rs As ResumableSub = diags.ShowCustom(p,"حفظ","","الغاء")
jRDC_get(code) 'This calls jRDC to reflect items
Wait For (rs) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
'Something will be done here
Return
This is the jRDC2 call:
Sub jRDC_get (code As String)
Dim req As DBRequestManager = CreateRequest
Dim cmd As DBCommand = CreateCommand("getitem", Array(code))
Wait For (req.ExecuteQuery(cmd, 0, Null)) JobDone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j, "req")
Wait For (req) req_Result(res As DBResult)
'work with result
req.PrintTable(res)
If res.Rows.Size = 0 Then
Return
Else
For Each row() As Object In res.Rows
Dim username As Object = row(res.Columns.Get("username"))
Dim app As Object = row(res.Columns.Get("app"))
Dim usermail As Object = row(res.Columns.Get("user_email"))
CLVS1.Add(CreateListItemSokan(app,username,usermail, CLVS1.AsView.Width, 200dip), "")
'Dim p As B4XView = xui.CreatePanel("")
Next
End If
Else
Log("ERROR: " & j.ErrorMessage)
End If
j.Release
End Sub