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 = "index.html"
page.PageTitle = "Parts Inventory"
page.PageDescription = "Parts Inventory"
page.PageKeywords = ""
page.PageSiteMapPriority = ""
page.PageSiteMapFrequency = ABM.SITEMAP_FREQ_YEARLY
page.ShowConnectedIndicator = True
' adding a navigation bar
ABMShared.BuildNavigationBar(page, "Parts Inventory","../images/snap.png", "", "", "")
' create the page grid
page.AddRowsM(5,True,0,0, "").AddCells12MPV(12,0,0,0,0,"","")
page.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
''page.Cell(1,6).AddComponent(ABMShared.BuildHeader(page, "hdr1", "Welcome to ABMaterial2!"))
''page.Cell(1,6).UseTheme("header")
''page.Cell(2,3).AddComponent(ABMShared.BuildParagraph(page, "pgr1", "This is a paragraph"))
''Dim btntext As String
''If tabs.GetActive =
Dim searchcont As ABMContainer
Dim searchbox As ABMInput
searchbox.Initialize(page, "searchbox", ABM.INPUT_SEARCH, "Search....", False, "input")
searchcont.Initialize(page, "searchcont", "")
btnsearch.InitializeRaised(page, "btnsearch", "mdi-action-search", ABM.ICONALIGN_CENTER, "Search Equip.", "button")
btnsearch.Size = ABM.BUTTONSIZE_LARGE
searchcont.AddRows(3, True, "").AddCellsOS(6,3,3,3,6,4,4,"")
searchcont.BuildGrid
searchcont.Cell(2,2).AddComponent(searchbox)
searchcont.Cell(3,3).AddComponent(btnsearch)
page.Cell(1,1).AddComponent(searchcont)
Dim tabs As ABMTabs
tabs.Initialize2(page, "tabs", 48,-8, 8, "tabs")
' create the tabs as ABMContainers
Dim cont As ABMContainer = BuildTabContainer("tab1", "{NBSP}Demo tab text TAB1")
Dim cont2 As ABMContainer = BuildTabContainer("tab2", "")
cont2.Initialize(page, "tblcont","tabpagewhite")
cont2.AddRows(1,True, "").AddCells12(1,"")
cont2.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
Dim tbl1 As ABMTable
''tbl1.Initialize(page, "tbl1", True, False, True, "tbl1theme")
Dim widths As List
widths.Initialize
''For i = 0 To 6
widths.Add(130)
widths.Add(140)
widths.Add(140)
widths.Add(150)
widths.Add(130)
widths.Add(130)
widths.Add(130)
''Next
''tbl1.InitializeScrollable(page, "tbl1", True, False, True, widths, "tbl1theme")
tbl1.Initialize(page, "tbl1", True, False, True, "tbl1theme")
tbl1.SetColumnWidths(widths)
tbl1.IsScrollable = True
tbl1.SetHeaders(Array As String("Type", "Model", "Serial No", "Owner", "Location", "Cal Due Date", "Actions"))
tbl1.SetColumnDataFields(Array As String("Type", "Model", "Serial No", "Owner", "Location", "Cal Due Date", "Actions"))
tbl1.SetHeaderThemes(Array As String("headerfooter", "headerfooter", "headerfooter", "headerfooter", "headerfooter", "headerfooter", "headerfooter"))
If DBM.GetSQL.IsInitialized Then
Dim sql As SQL
sql = DBM.GetSQL
Else
DBM.InitializeSQLite(File.DirApp, "LabInventory.db", False)
sql = DBM.GetSQL
End If
Dim rs As ResultSet
rs = sql.ExecQuery("SELECT rowid, Type, Model, SerialNo, Owner, Location, CalibrationDue FROM Equipment")
Dim n As Int = 0
Do While rs.NextRow
Dim cols As List
Dim rCellThemes As List
rCellThemes.Initialize
cols.Initialize
n = n + 1
If n Mod 2 = 0 Then
cols.Add(rs.GetString("Type"))
rCellThemes.Add("positive")
cols.Add(rs.GetString("Model"))
rCellThemes.Add("positive")
cols.Add(rs.GetString("SerialNo"))
rCellThemes.Add("positive")
cols.Add(rs.GetString("Owner"))
rCellThemes.Add("positive")
cols.Add(rs.GetString("Location"))
rCellThemes.Add("positive")
cols.Add(rs.GetString("CalibrationDue"))
rCellThemes.Add("positive")
Dim update As ABMButton
update.InitializeRaised(page, "update"&n, "", "", "Update", "")
cols.Add(update)
rCellThemes.Add("positive")
Else
cols.Add(rs.GetString("Type"))
rCellThemes.Add("nocolor")
cols.Add(rs.GetString("Model"))
rCellThemes.Add("nocolor")
cols.Add(rs.GetString("SerialNo"))
rCellThemes.Add("nocolor")
cols.Add(rs.GetString("Owner"))
rCellThemes.Add("nocolor")
cols.Add(rs.GetString("Location"))
rCellThemes.Add("nocolor")
cols.Add(rs.GetString("CalibrationDue"))
rCellThemes.Add("nocolor")
Dim update As ABMButton
update.InitializeRaised(page, "update"&n, "", "", "Update", "")
cols.Add(update)
rCellThemes.Add("nocolor")
End If
Log("rowid: " & rs.GetString("rowid"))
tbl1.AddRow("uid"&rs.GetString("rowid"), cols)
tbl1.SetCellTag(n-1, 0, rs.GetString("rowid"))
tbl1.SetRowThemes(rCellThemes)
Loop
sql.Close
Log("column list size: " & cols.Size)
Log("rcellthemes list size: " & rCellThemes.Size)
cont2.Cell(1,1).SetFixedHeight(450, True)
cont2.Cell(1,1).AddComponent(tbl1)
tabs.AddTab("Parts", "EE Parts", cont,3,3,3,12,12,12,True,False, "mdi-hardware-memory", "")
tabs.AddTab("Equipment", "Equipment Inventory", cont2,3,3,3,12,12,12,True,True, "mdi-action-work", "")
tabs.AddTab("tab3", "Demo TAB 3 Text", BuildTabContainer("tab3", "{NBSP}Demo tab text TAB3"),3,3,3,12,12,12,True,False, "mdi-editor-insert-comment", "")
page.Cell(2,1).AddComponent(tabs)
End Sub