Hi
I call connectpage and the ABMChronologyList is display ok When i open page first.
secondly, when i change a new date and call connectpage again. the ABMChronologyList isn't display. Why .. !?
I call connectpage and the ABMChronologyList is display ok When i open page first.
secondly, when i change a new date and call connectpage again. the ABMChronologyList isn't display. Why .. !?
B4X:
public Sub ConnectPage(now As Long)
'NEW
ABMShared.ConnectNavigationBar(page,"")
' add paragraph
Dim chrono As ABMChronologyList
chrono.Initialize(page, "chrono", "chrono")
chrono.clear
Dim lst As List=historydb.kvs.ListKeys(now)
If lst.Size>0 Then
For n1=1 To lst.Size
Dim s1 As String=lst.Get(n1-1)
Dim mp1 As Map=historydb.kvs.GetObject(s1)
BuildFiche(chrono,"evt"&n1, s1,mp1)
Next
'chrono.Refresh
End If
page.Cell(2,1).AddComponent(chrono)
' chronolist test
' also add the components to the footer
'ABMShared.ConnectFooter(page)
page.Refresh ' IMPORTANT!
' NEW, because we use ShowLoaderType=ABM.LOADER_TYPE_MANUAL
page.FinishedLoading 'IMPORTANT
page.RestoreNavigationBarPosition
End Sub
B4X:
Sub BuildFiche(chrono As ABMChronologyList,id As String, eventid As String, data As Map)
' 11112233445566
Dim s1 As String=$"${eventid.SubString2(4,6)}/${eventid.SubString2(6,8)} ${eventid.SubString2(8,10)}:${eventid.SubString2(10,12)}:${eventid.SubString2(12,14)}"$
Dim Fiche As ABMContainer
Dim theme1 As String="green"
'
Fiche.Initialize(page, id&"cnt", "")
Fiche.AddRowsM(1, False,0,0,"green").AddCellsOSMP(1,0,0,0,12,12,12,0,12,10,10,"")
Fiche.AddRowsM(1, False ,0,0, "").AddCellsOSMP(1,0,0,0,12,12,12,0,0,11,11,"")
Fiche.BuildGrid
Fiche.Row(1).MarginLeft = "0"
Fiche.Row(1).MarginRight = "0"
'
Dim titLabel As ABMLabel
titLabel.Initialize(page, id&"lbl1" & id, s1, ABM.SIZE_H5,False, "green")
Fiche.Cell(1,1).AddComponent(titLabel)
If data.IsInitialized Then
Dim s2 As String=data.Get("type")
Dim titLabel2 As ABMLabel
titLabel2.Initialize(page, id&"lbl2" & id, s2, ABM.SIZE_H6,False, "white")
Fiche.Cell(1,1).AddComponent(titLabel2)
Fiche.Cell(2,1).AddComponent(BuildCard(id,data))
End If
chrono.AddSlide(id,Fiche, theme1)
End Sub
B4X:
Sub BuildCard(id As String, data As Map) As ABMTable
Dim tbl As ABMTable
tbl.Initialize(page, id&"tbl", True, False, True, "tbl1theme")
'tbl.SetColumnWidths(Array As Int(10,40))
If data.Size>0 Then
For n1=1 To data.Size
Dim s1 As String=data.GetKeyAt(n1-1)
If (s1<>"eventid")And(s1<>"type") Then
Dim row As List
row.Initialize
row.Add(data.GetKeyAt(n1-1))
row.Add(data.GetValueAt(n1-1))
tbl.AddRow(id&"row"&n1,row)
tbl.SetRowThemes(Array As String("cellleft","cellleft"))
End If
Next
End If
Return tbl
End Sub
