Am I missing something? Below I post the relevant snippet code
And in jobdone I want to populate the values for the bar chart.
And there are a couple of warnings
Waiting for value (100 ms)
Unexpected event (missing RaiseSynchronousEvents): abmcomp_build
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1336)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:199)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:168)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at com.ab.abmaterial.ABMCustomComponent.Build(Unknown Source)
at com.ab.abmaterial.ABMCell.RefreshInternalExtra(Unknown Source)
at com.ab.abmaterial.ABMRow.RefreshInternal(Unknown Source)
at com.ab.abmaterial.ABMPage.Refresh(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:672)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:168)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
and...
Unexpected event (missing RaiseSynchronousEvents): abmcomp_firstrun
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1336)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:199)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:168)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at com.ab.abmaterial.ABMCustomComponent.FirstRun(Unknown Source)
at com.ab.abmaterial.ABMComponent.RunAllFirstRuns(Unknown Source)
at com.ab.abmaterial.ABMCell.RefreshInternalExtra(Unknown Source)
at com.ab.abmaterial.ABMRow.RefreshInternal(Unknown Source)
at com.ab.abmaterial.ABMPage.Refresh(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:672)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:168)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
Any tips?
Thanks, Diego
B4X:
public Sub BuildPage()
' initialize the theme
BuildTheme
' initialize this page using our theme
page.InitializeWithTheme(Name, "/ws/" & ABMShared.AppName & "/" & Name, False, ABMShared.SessionMaxInactiveIntervalSeconds, theme)
page.ShowLoader=True
page.PageHTMLName = "estadistica.html"
page.PageTitle = "Estadistica"
page.PageDescription = "Estadistica"
page.PageKeywords = ""
page.PageSiteMapPriority = ""
page.PageSiteMapFrequency = ABM.SITEMAP_FREQ_YEARLY
page.ShowConnectedIndicator = True
' adding a navigation bar
ABMShared.BuildNavigationBar(page, "EnviaPy - Estadisticas","../images/logo.png", "", "", "")
theme.AddCellTheme("centercontent")
theme.Cell("centercontent").Align = ABM.CELL_ALIGN_CENTER
' create the page grid
page.AddRow(1,True,"","")
page.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
page.AddExtraJavaScriptFile("custom/frappe-charts.min.iife.425.js")
End Sub
B4X:
public Sub ConnectPage()
' connecting the navigation bar
ABMShared.ConnectNavigationBar(page)
FrappeChart1.Initialize(page, "FrappeChart1", "bar", "Estadistica por Hora", 250)
'llamar al job al SQL que trae las cantidades
Dim job As HttpJob
Dim serverurl As String
Dim fecini,fecfin As String
fecini = "20190101"
fecfin = "20190131"
serverurl = "database_retrieval.aspx"
job.Initialize("Job1",Me)
job.Download2(serverurl,Array As String("fecini",fecini,"fecfin",fecfin))
' refresh the page
' page.Refresh
' Tell the browser we finished loading
page.FinishedLoading
' restoring the navigation bar position
page.RestoreNavigationBarPosition
End Sub
And in jobdone I want to populate the values for the bar chart.
B4X:
Sub jobdone (Job As HttpJob)
'page.Msgbox("","Entro","Error","Aceptar",False,"","")
If Job.Success Then
If Job.JobName = "Job1" Then
Dim parser As JSONParser
Dim response As String = Job.GetString
Dim valores As List
Dim valor As Int
valores.Initialize()
'Msgbox("entro","")
parser.Initialize(response)
Dim rows As List
rows = parser.NextArray
If rows.Size = 0 Then
'page.Msgbox("contraseña_i","Error de Usuario y/o Contraseña","Error","Aceptar",False,"","")
'Return
End If
'work with result
'rows is a List. Each item is a Map with the columns names as keys and the db values as the values.
FrappeChart1.FrappeLabels.AddAll(Array As String("7", "8", "9", "10","11", "12", "13", "14","15","16","17","18","19","20","21","22","23","24"))
For i = 0 To rows.Size - 1
'Log("Rows #" & i)
Dim m As Map
m = rows.Get(i)
' Msgbox(i,"")
'Msgbox(m.Get("idrepartidor"),"")
'page.Msgbox("contraseña_i",m.Get("idcliente"),"Error","Aceptar",False,"","")
valor = m.Get("cantidad")
valores.Add(valor)
DateTime.DateFormat = "dd/MM/yyyy hh:mm"
'FrappeChart1.AddDataSet("Cant. Pedidos", "light-blue", Array As Int(25, 40, 30, 35, 8, 52, 17, -4), Array As String())
Next
FrappeChart1.AddDataSet("Cant. Pedidos", "light-blue", valores, Array As String())
End If
End If
Job.Release
page.Cell(1,1).AddComponent(FrappeChart1.ABMComp)
'Main.cerrado = False
page.Refresh
End Sub
And there are a couple of warnings
Waiting for value (100 ms)
Unexpected event (missing RaiseSynchronousEvents): abmcomp_build
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1336)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:199)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:168)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at com.ab.abmaterial.ABMCustomComponent.Build(Unknown Source)
at com.ab.abmaterial.ABMCell.RefreshInternalExtra(Unknown Source)
at com.ab.abmaterial.ABMRow.RefreshInternal(Unknown Source)
at com.ab.abmaterial.ABMPage.Refresh(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:672)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:168)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
and...
Unexpected event (missing RaiseSynchronousEvents): abmcomp_firstrun
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1336)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:199)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:168)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at com.ab.abmaterial.ABMCustomComponent.FirstRun(Unknown Source)
at com.ab.abmaterial.ABMComponent.RunAllFirstRuns(Unknown Source)
at com.ab.abmaterial.ABMCell.RefreshInternalExtra(Unknown Source)
at com.ab.abmaterial.ABMRow.RefreshInternal(Unknown Source)
at com.ab.abmaterial.ABMPage.Refresh(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:672)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:168)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
Any tips?
Thanks, Diego