B4J Question JRDC2 - Help

StarinschiAndrei

Active Member
Licensed User
Longtime User
Hi everyone,
Could anybody help me how to solve the following situation ? i would like to wait until searchview is populated.
I modified searchview class - added set_text method
Pass a value to searchview and simulate click or enter in searchview

B4X:
Sub Class_Globals
    Private fx As JFX
    Private SV As SearchView
    Private xui As XUI
End Sub

'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize (vatNo As String)

    Main.MainTBP.LoadLayout("scr_customer","Customer Form")
    CallSubDelayed(Me,"fill_SV")
    If vatNo<>"" then 
        SV.set_text(vatNo)
        SV.lv_MouseClicked
    End if
End Sub
Sub fill_SV
    Dim cmd As DBCommand=jRDC2Utils.CreateCommand("get_ALL_VAT_number",Array())
    Wait For(jRDC2Utils.ExecuteQuery(cmd)) complete(res As DBResult)
    Dim vatNoLst As List
    vatNoLst.Initialize
    For i=0 To res.Rows.Size-1
        vatNoLst.Add(jRDC2Utils.GetColumnObject(res,i,"vatNo"))
    Next
    SV.SetItems(vatNoLst)
End Sub
Searchview class:
Public Sub set_text(text As String)
    et.Text=text
End Sub
 

StarinschiAndrei

Active Member
Licensed User
Longtime User
Hello Erel , thank you for your answer , i made the changes
B4X:
Public Sub Initialize (vatNo As String)
    Main.MainTBP.LoadLayout("scr_customer","Customer Form")
    Dim RS As ResumableSub=fill_SV
    Wait For (RS) Complete (Result As Int)
End Sub
1612343460142.png
 
Upvote 0

StarinschiAndrei

Active Member
Licensed User
Longtime User
B4X:
Public Sub Initialize (vatNo As String)
   DownloadAndFillList
End Sub

Sub DownloadAndFillList
Main.MainTBP.LoadLayout("scr_customer","Customer Form")
    Dim RS As ResumableSub=fill_SV
    Wait For (RS) Complete (Result As Int)
...
End Sub
THANK YOU
 
Upvote 0
Top