I'm working on server development by following the following example:
https://www.b4x.com/android/forum/t...device-desktop-and-web-reports.37254/#content
I need to return a list with data from a table:
ID, Name, Age, Email
With their respective data.
This list needs to be sent to a B4J application that is loading its data into a TableViewer.
Is there any example with these codes? Because I did not find anything like this:
'// B4J Server:
'// B4J Client:
I will be very grateful for the help
https://www.b4x.com/android/forum/t...device-desktop-and-web-reports.37254/#content
I need to return a list with data from a table:
ID, Name, Age, Email
With their respective data.
This list needs to be sent to a B4J application that is loading its data into a TableViewer.
Is there any example with these codes? Because I did not find anything like this:
'// B4J Server:
B4X:
Sub Handle(req As ServletRequest, resp As ServletResponse)
Dim resp As Map = DBUtils.ExecuteMap(Main.SQL, "SELECT * FROM Animals")
resp.ContentType = "Map" '// Map ? '// how to set a list or map to client?
resp.Write(resp)
End Sub
'// B4J Client:
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private TableView As TableView
Private raf As RandomAccessFile
Private link As String
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
raf.Initialize(File.DirTemp, "temp", False)
MainForm.Title = "Tabela {Pessoas} em http://IP:porta em {BdServidor.db}"
End Sub
Sub btnDadosExibirNoTableView_Action
link = "http://localhost:51042"
Dim j As HttpJob
j.Initialize("report2", Me)
j.Download(link & "/Relatorio2")
pi1.Visible = True
End Sub
Sub JobDone(j As HttpJob)
If j.Success Then
If j.JobName = "report2" Then
'// how to get a list or map in a tableview?
TableView.Items.AddAllAt( j.GetString2(" Map???? ") )
End if
End If
End Sub
I will be very grateful for the help