public Sub ConnectPage()
' determine what device the app is running on...
' Note: This can only be called from ConnectPage since we now have a web socket...
Dim ip As Boolean = (page.IsPhone) Or (page.IsTablet) ' (ip = is_phone)
page.AddModalSheetTemplate(BuildInputSheet)
Dim cc1,cc2,cc3,cc4 As Int = 0
page.AddRowsM(1,True,0,0, "").AddCellsOS(4,0,0,0,3,3,3,"")
cc1 = 1 ' these are cell positions - not actually needed but used during testing
cc2 = 2
cc3 = 3
cc4 = 4
Log("initing extra content")
' Now create a navbar with extra content (code to follow). This clears the previous one and makes a new...
' Note: the last param tellls the method what device is being used...
ABMShared.BuildNavigationBarEX(page, "Review Agenda", "../images/logo.png", "Agenda", "", "", ip)
' causes the extra content to show - or hide (see method below)
ExtraButton_Clicked("")
' create the page grid. Our database data will show here...
page.AddRows(1, True, "").AddCellsOSMP(1,0,0,0,12, 12, 12,0,0,0,0,"") '.AddCellsOSMP(1,0,0,0,2,2,2,0,0,0,0,"").AddCellsOSMP(1,0,0,0,2,2,2,0,0,0,0,"")
page.AddRows(4,True, "").AddCells12(1,"")
page.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
' dummy spacer for top of page
Dim searchUser As ABMLabel
searchUser.Initialize(page, "lb1", " ", ABM.SIZE_H5, False, "lightblue")
page.CellR(0,1).AddComponent(searchUser)
' determine the permission level from the active logged in user...
ActiveUserId = page.ws.Session.GetAttribute2("UserID",0)
' set the public device size
ABMShared.setScrnSize( page)
Dim mtlist As ABMCombo
mtlist.Initialize(page,"mtlist1","SELECT AGENDA DATE",350,"")
Dim SQL As SQL = DBM.GetSQL
Dim ctype As List = DBM.SQLSelect(SQL, "SELECT createdate, name, id, agndoc From cmeetmast where comp_id = " &Main.comp_id& " ORDER BY createdate DESC LIMIT 13 " , Null)
For i = 0 To ctype.Size-1
Dim ctt As Map = ctype.Get(i)
Dim cnum As Int = ctt.Get("id")
Dim cname As String = ctt.Get("name")
Dim agn As String = ctt.Get("agndoc")
Log("What is agn doc name: "&agn)
If agn.Length > 8 Then
mtlist.AddItem( ""&cnum, cname, BuildSimpleItem("S1"&cnum, "mdi-action-grade", "{NBSP}{NBSP}"&cname&""))
End If
Next
' !!! NOTE - IMPORTANT !!!
' the extra content is a container... add the component to the extracontent container cell
page.NavigationBar.ExtraContent.CellR(1,cc1).AddComponent(mtlist)
Dim agend As ABMCombo
agend.Initialize(page,"agend","SELECT AGENDA ITEM",300, "")
Dim sql_str As String = "Select * from cagenda where comp_id = 0 OR comp_id = "&Main.comp_id
Dim head As List = DBM.SQLSelect(SQL, sql_str ,Null)
If head.Size > 0 Then
For i = 0 To head.Size -1
Dim mp As Map = head.Get(i)
Dim id As Int = mp.Get("id")
Dim fn As String = mp.Get("name")
agend.AddItem(""&id, fn, BuildSimpleItem("11", "mdi-action-star-rate", fn))
Next
End If
DBM.CloseSQL(SQL)
page.NavigationBar.ExtraContent.CellR(0,cc2).AddComponent(agend)
Dim btnshowallagenda As ABMSwitch
btnshowallagenda.Initialize2( page , "btnshowallagenda", "{C:#000000}{B}SHOW ALL ITEMS{/B}{/C}" , "", " ", False, "swt1")
btnshowallagenda.State = True
page.NavigationBar.ExtraContent.CellR(0,cc3).AddComponent(btnshowallagenda)
Dim btnshowallcomm As ABMSwitch
btnshowallcomm.Initialize2( page , "btnshowallcomm", "{C:#000000}{B}SHOW ALL COMMENTS{/B}{/C}", ""," ", False, "swt1")
btnshowallcomm.State = True
page.NavigationBar.ExtraContent.CellR(0,cc4).AddComponent(btnshowallcomm)
' these are local page items... added to the page...
Dim newcases As ABMLabel
newcases.Initialize(page, "newcases", "{NBSP}{NBSP} Motions Presented ", ABM.SIZE_H5, False, "lightblue")
page.Cell(4,1).AddComponent(newcases)
Dim pagination As ABMPagination
pagination.Initialize(page, "pagination", 2, True, True, "")
pagination.SetTotalNumberOfPages(0)
page.Cell(4,1).AddComponent(pagination)
' This WAS the old method of using a responsive table - Looks and Works horribly!
' This system is replace on small devices using custom cards.
' It is still used when using app on a desktop - where it looks and works fantastico...
Dim tblCases As ABMTable
tblCases.IsResponsive = True
tblCases.Initialize(page, "tblCases", False, False, True, "tbltheme")
If ABMShared.ScrnSize = 0 Then
tblCases.SetHeaders( Array As String ("ID" ,"Num" , "Meeting Date" , "Summary" , "Description" , "Attachments" , "Comment","View", "Delete"))
tblCases.SetHeaderThemes( Array As String ("bg" ,"bg" ,"bg" , "bg" , "bg" ,"bg" , "bgc" , "bgc" , "bgc" ))
tblCases.SetHeaderHeights( Array As Int (0 , 0 ,0 , 0 , 0 , 0 , 48 , 48 , 48 ))
tblCases.SetColumnVisible( Array As Boolean(False, True ,True , True , True , True , True ,True , False ))
' tblCases.SetColumnWidths( Array As Int( 1, 0 , 0 , 0, 0, 0, 0, 0, 0 ))
Else
tblCases.SetHeaders( Array As String ("ID" ,"Num" , "Meeting Date" , "Summary" , "Description" , "Attachments" , "Comment","View", "Delete"))
tblCases.SetHeaderThemes( Array As String ("bg" ,"bg" ,"bg" , "bg" , "bg" ,"bg" , "bgc" , "bgc" , "bgc" ))
' tblCases.SetHeaderHeights( Array As Int (0 , 0 ,0 , 0 , 100 , 70 , 48 , 48 , 48 ))
tblCases.SetColumnVisible( Array As Boolean(False, True ,True , True , True , True , True ,True , False ))
tblCases.SetColumnWidths( Array As Int( 1, 0 , 0 , 0, 600, 0, 0, 0, 0 ))
End If
tblCases.SetFooter("Totals: 0", 12, "bg")
page.Cell(5,1).AddComponent(tblCases)
If ABMShared.ScrnSize < 2 Then
' hide this table on all small devices...
tblCases.Visibility = ABM.VISIBILITY_HIDE_ALL
End If
' configure our menu sidebar with options appropriate for this logged in user...
ABMShared.AdminPages(page)
page.Refresh ' IMPORTANT
' NEW, because we use ShowLoaderType=ABM.LOADER_TYPE_MANUAL
page.FinishedLoading 'IMPORTANT
End Sub