Sub Class_Globals
...
Private graphSetupRec As graphSetupRec_t
Private graphSetupList As List ...
End Sub
'======================================================================================
Public Sub Initialize (Callback As Object, EventName As String)
mEventName = EventName
mCallBack = Callback
cmboGraphGroupMap.Initialize
graphGroupRec.Initialize
graphSetupList.Initialize
End Sub
'======================================================================================
Sub CreateGraphSetupListItem As Pane
Dim p As AnchorPane
p.Initialize("")
p.LoadLayout("cvGraphSetups.bjl")
'Set fields from data base list'
lblID.Text = graphSetupRec.ID
txtXgTitle.Text = graphSetupRec.title ...
...
cbShowXUnits.Checked = graphSetupRec.showXUnits
Return p
End Sub
'======================================================================================
Private Sub getGraphSetupRecords(grpID As Int) As ResumableSub
Dim req As DBRequestManager = CreateRequest(rdcLink)
Dim cmd As DBCommand
graphSetupList.Clear
Try
' Get the Graph Setup Data Set for the Current Garph Group ID
cmd = CreateCommand("getGraphSetup", Array As String(grpID))
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)
Process the results
For Each row() As Object In res.Rows
Private graphSetupRec As graphSetupRec_t
graphSetupRec.Initialize
graphSetupRec.ID = row(0) ...
...
graphSetupRec.showXUnits = intToBool(row(32))
graphSetupList.Add(graphSetupRec)
' Add to custom list view of Graph Setups
cViewGraphSetups.Add(CreateGraphSetupListItem, 185)
Next
Else
Return False
Log("ERROR: " & j.ErrorMessage)
End If
j.Release
Return True
Catch
Log(LastException)
Return False
End Try
End Sub